fir-cli 1.7.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8c6da4ee5e12418303fdb4050554e145e04ce70b033e4460f6ca390d1fd9e18
4
- data.tar.gz: ce18cbd160ac0018f5e04d1c02076281d162107449b6d3bdc5d647d5728aa1d9
3
+ metadata.gz: f519307fd500f9c5abcb1f9e58bb07a400b1c2d4e83c86bd497f78bdbe697872
4
+ data.tar.gz: d1fb7013596a6f40b9604d9ada08b72e473b4eaaa63f1b84e2428e914f7155d4
5
5
  SHA512:
6
- metadata.gz: df1656d6250cdc7224eb7f4a5f1fe6a83df2cc3a6bd12d73b9d0a9c4582c5139ab575e5911d9077209700225865256a668e122310f77077d30fe0fd2cdf1ce73
7
- data.tar.gz: f6f70fc679141dad2be96059a31b64542cd1f22f7d98538cedcb5642c72db41b26e873f8e156bf56d4e5c01ccd5d63cdec652ddd9b5d7ec0112a8cc4eb8a599d
6
+ metadata.gz: 227a5f10ffb7fa3de80000b3e49549a39978df87dcf3a3d271bca90eabf89fd25baa8b758fbd88b88ca3fd9bcabb0cce809347c8b83115fe63091d57c28ac05a
7
+ data.tar.gz: 34374e11164cb8d8213ae3f71d0cafa66e4232673f01478fd94f72f9157b4ec099192a0522b5cf5a3265b90da8d7728dc982b7e1292e07032644c65fc3eeb577
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM ruby:2.4.2
1
+ FROM ruby:2.6.1
2
2
  RUN gem install bundler
3
3
  ENV LANG=C.UTF-8
4
4
  ENV WORKDIR=/fir-cli
data/Gemfile CHANGED
@@ -1,12 +1,10 @@
1
1
  # coding: utf-8
2
- if ENV['USE_OFFICIAL_GEM_SOURCE']
3
- source 'https://rubygems.org'
4
- else
2
+ if ENV['USE_CHINA_GEM_SOURCE']
5
3
  source 'http://gems.ruby-china.com'
4
+ else
5
+ source 'https://rubygems.org'
6
6
  end
7
7
 
8
- # gem 'byebug'
9
8
  # Specify your gem's dependencies in fir.gemspec
10
9
  gemspec
11
- gem 'byebug'
12
10
  gem 'codeclimate-test-reporter', group: :test, require: nil
data/README.md CHANGED
@@ -13,9 +13,10 @@ fir.im-cli 可以通过指令查看, 上传, iOS/Android 应用.
13
13
  ![fir-cli](http://7rf35s.com1.z0.glb.clouddn.com/fir-cli-new.gif)
14
14
 
15
15
 
16
- # 重要提示
16
+ # 最近更新
17
+ - 官方支持 钉钉推送, 使用方法为 在publish 中增加 --dingtalk_access_token=xxxxxxxxxxxxxxxxxxx (或者 -D=xxxxxxx)
18
+ - 官方支持 上传完毕后, 返回精确的版本的下载地址, 使用方案为 在 publish 后增加 --need_release_id (特定版本支持近期30个以内的任意版本)
17
19
  - 已过期 build_ipa 功能, 推荐用户使用 fastlane (fastlane gym)进行打包,生成好 ipa 文件后,再使用 `fir publish` 上传生成的ipa [2019年03月21日]
18
- - 由于 CDN 厂商技术原因, 部分老版本用户会出现 579 错误,解决该问题请升级fir-cli 至最新版
19
20
  - 由于部分地区上传时遇到的证书问题, 新版本默认忽略证书校验. 如需打开, 请在命令前加入`UPLOAD_VERIFY_SSL=1`
20
21
  - 现已添加 docker 版本, 具体请见 `Docker 运行 fir-cli ` 说明
21
22
  - 关于因为境外到境内网络不佳的而在上传出现 `stream closed`的问题, 我们已经联系了 CDN 厂商处理, 并将超时时间改为了 300 (秒), 如需修改, 可传入环境变量 `FIR_TIMEOUT=xxx`
@@ -23,8 +24,6 @@ fir.im-cli 可以通过指令查看, 上传, iOS/Android 应用.
23
24
  ## 文档
24
25
 
25
26
  - [安装及常见安装问题](https://github.com/FIRHQ/fir-cli/blob/master/doc/install.md)
26
- - [fir help 相关指令帮助](https://github.com/FIRHQ/fir-cli/blob/master/doc/help.md)
27
- - [fir info 查看 ipa/apk 信息](https://github.com/FIRHQ/fir-cli/blob/master/doc/info.md)
28
27
  - [fir login & fir me 登录相关](https://github.com/FIRHQ/fir-cli/blob/master/doc/login.md)
29
28
  - [fir publish 发布应用到 fir.im](https://github.com/FIRHQ/fir-cli/blob/master/doc/publish.md)
30
29
  - [fir upgrade 升级相关](https://github.com/FIRHQ/fir-cli/blob/master/doc/upgrade.md)
@@ -57,6 +56,7 @@ fir help
57
56
  ```
58
57
 
59
58
  ## 最近更新
59
+ - (1.7.1) 新增发布后可选返回精确到版本的下载地址, 以及支持钉钉推送
60
60
  - (1.7.0) 过期了ipa_build 功能, 增加了对 android manifest instant run 的兼容
61
61
  - (1.6.13) 上传图标逻辑修改
62
62
  - (1.6.12) 修复了部分机器没有默认安装 byebug 的问题
data/doc/publish.md CHANGED
@@ -15,6 +15,8 @@ Options:
15
15
  [--password=PASSWORD] # Set password for app
16
16
  -T, [--token=TOKEN] # User's API Token at fir.im
17
17
  -L, [--logfile=LOGFILE] # Path to writable logfile
18
+ -R, [--need_release_id] # show release_id in download_url
19
+ -D, [--dingtalk_accesss_token=DINGTALK_ACCESS_TOKEN] # dingtalk notification
18
20
  -V, [--verbose], [--no-verbose] # Show verbose
19
21
  # Default: true
20
22
  -q, [--quiet], [--no-quiet] # Silence commands
@@ -28,6 +30,8 @@ Options:
28
30
  - `-Q` 参数, 是否生成发布后二维码, 默认为不生成, 加上 `-Q` 参数后会在当前目录生成一张二维码图片, 扫描该图片即可下载该应用.
29
31
  - `-m` 参数, 上传当前应用的符号表文件, 配合 `-P` 参数使用.
30
32
  - `-P` 参数, [BugHD.com](http://bughd.com) 上相对应的 Project id.
33
+ - `-R` 参数, 显示具体版本, 会在发布结束后的下载地址中生成指定的版本
34
+ - `-D` 参数, 钉钉机器人的access_token, 填写后当上传完毕, 会发送至钉钉机器人
31
35
  - `--open` 参数, 设置发布后的应用是否开放给所有人下载, 关闭开放使用 `--no-open` 参数.
32
36
  - `--password` 参数, 设置发布后的应用密码
33
37
 
data/fir-cli.gemspec CHANGED
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
27
27
  /_/ /___/_/ |_| \____/_____/___/
28
28
 
29
29
  ## 更新记录
30
+ - (1.7.1) 增加了 钉钉推送 , 增加了返回指定版本下载地址
30
31
  - (1.7.0) 过期了ipa_build 功能, 增加了对 android manifest instant run 的兼容
31
32
  - (1.6.13) 上传图标逻辑修改
32
33
  - (1.6.12) 修复了部分机器没有默认安装 byebug 的问题
@@ -35,8 +36,8 @@ Gem::Specification.new do |spec|
35
36
  - 欢迎 fork, issue 和 pull request
36
37
  )
37
38
 
38
- spec.add_development_dependency 'bundler', '~> 1.7'
39
- spec.add_development_dependency 'rake', '~> 10.0'
39
+ spec.add_development_dependency 'bundler'
40
+ spec.add_development_dependency 'rake'
40
41
  spec.add_development_dependency 'minitest', '~> 5.7'
41
42
  spec.add_development_dependency 'pry', '~> 0.10'
42
43
 
@@ -45,6 +46,5 @@ Gem::Specification.new do |spec|
45
46
  spec.add_dependency 'ruby_android', '~> 0.7.7'
46
47
  spec.add_dependency 'rqrcode', '~> 0.7'
47
48
  spec.add_dependency 'CFPropertyList'
48
- spec.add_dependency 'api_tools'
49
- spec.add_dependency 'byebug'
49
+ spec.add_dependency 'api_tools', '~> 0.1.0'
50
50
  end
data/lib/fir/cli.rb CHANGED
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  module FIR
4
4
  class CLI < Thor
@@ -24,7 +24,7 @@ module FIR
24
24
 
25
25
  $ fir bi <workspace dir> -w -S <scheme name> [-C <configuration>] [-t <target name>] [-o <ipa output dir>] [settings] [-c <changelog>] [-p -Q -T <your api token>]
26
26
  LONGDESC
27
- map ['b', 'bi'] => :build_ipa
27
+ map %w[b bi] => :build_ipa
28
28
  method_option :branch, type: :string, aliases: '-B', desc: 'Set branch if project is a git repo, the default is `master`'
29
29
  method_option :workspace, type: :boolean, aliases: '-w', desc: 'true/false if build workspace'
30
30
  method_option :scheme, type: :string, aliases: '-S', desc: 'Set the scheme NAME if build workspace'
@@ -32,7 +32,7 @@ module FIR
32
32
  method_option :destination, type: :string, aliases: '-d', desc: 'Set the destination specifier'
33
33
  method_option :target, type: :string, aliases: '-t', desc: 'Build the target specified by target name'
34
34
  method_option :export_method, type: :string, aliases: '-E', desc: 'for exportOptionsPlist method, ad-hoc as default'
35
- method_option :optionPlistPath, type: :string, aliases: '-O', desc: 'User defined exportOptionsPlist path'
35
+ method_option :optionPlistPath, type: :string, aliases: '-O', desc: 'User defined exportOptionsPlist path'
36
36
  method_option :profile, type: :string, aliases: '-f', desc: 'Set the export provisioning profile'
37
37
  method_option :output, type: :string, aliases: '-o', desc: 'IPA output path, the default is: BUILD_DIR/fir_build_ipa'
38
38
  method_option :publish, type: :boolean, aliases: '-p', desc: 'true/false if publish to fir.im'
@@ -107,9 +107,11 @@ module FIR
107
107
  method_option :short, type: :string, aliases: '-s', desc: 'Set custom short link'
108
108
  method_option :changelog, type: :string, aliases: '-c', desc: 'Set changelog'
109
109
  method_option :qrcode, type: :boolean, aliases: '-Q', desc: 'Generate qrcode'
110
-
110
+ method_option :need_release_id, type: :boolean, aliases: '-R', desc: 'Add release id with fir url (WARNING: FIR ONLY SAVED 30 releases recently per app'
111
+
111
112
  method_option :mappingfile, type: :string, aliases: '-m', desc: 'App mapping file'
112
- method_option :proj, type: :string, aliases: '-P', desc: 'Project id in BugHD.com if upload app mapping file'
113
+ method_option :dingtalk_access_token, type: :string, aliases: '-D', desc: 'Send msg to dingtalk, only need access_token, not whole url'
114
+
113
115
  method_option :open, type: :boolean, desc: 'true/false if open for everyone'
114
116
  method_option :password, type: :string, desc: 'Set password for app'
115
117
  def publish(*args)
@@ -171,7 +173,7 @@ module FIR
171
173
  def prepare(task)
172
174
  if options.help?
173
175
  help(task.to_s)
174
- fail SystemExit
176
+ raise SystemExit
175
177
  end
176
178
  $DEBUG = true if ENV['DEBUG']
177
179
  end
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative './common'
4
-
5
- require 'byebug'
6
4
  module FIR
7
5
  module Parser
8
6
  class Apk
@@ -1,7 +1,4 @@
1
1
  # frozen_string_literal: true
2
-
3
- #require 'byebug'
4
-
5
2
  module FIR
6
3
  module Publish
7
4
  def publish(*args, options)
@@ -18,10 +15,10 @@ module FIR
18
15
  upload_app
19
16
 
20
17
  logger_info_dividing_line
21
- logger_info_app_short_and_qrcode
18
+ logger_info_app_short_and_qrcode(options)
22
19
 
20
+ dingtalk_notifier(options)
23
21
  upload_mapping_file_with_publish(options)
24
-
25
22
  logger_info_blank_line
26
23
  end
27
24
 
@@ -73,16 +70,16 @@ module FIR
73
70
  large_icon_path = @app_info[:icons].max_by { |f| File.size(f) }
74
71
  @uncrushed_icon_path = convert_icon(large_icon_path)
75
72
  {
76
- key: @icon_cert[:key],
73
+ key: @icon_cert[:key],
77
74
  token: @icon_cert[:token],
78
- file: File.new(@uncrushed_icon_path, 'rb'),
75
+ file: File.new(@uncrushed_icon_path, 'rb'),
79
76
  'x:is_converted' => '1'
80
77
  }
81
78
  end
82
79
 
83
80
  def icon_information
84
81
  {
85
- key: @icon_cert[:key],
82
+ key: @icon_cert[:key],
86
83
  token: @icon_cert[:token],
87
84
  origin: 'fir-cli',
88
85
  parent_id: @app_id,
@@ -112,15 +109,15 @@ module FIR
112
109
 
113
110
  def uploading_binary_info
114
111
  {
115
- key: @binary_cert[:key],
112
+ key: @binary_cert[:key],
116
113
  token: @binary_cert[:token],
117
- file: File.new(@file_path, 'rb'),
114
+ file: File.new(@file_path, 'rb'),
118
115
  # Custom variables
119
- 'x:name' => @app_info[:display_name] || @app_info[:name],
120
- 'x:build' => @app_info[:build],
121
- 'x:version' => @app_info[:version],
122
- 'x:changelog' => @changelog,
123
- 'x:release_type' => @app_info[:release_type],
116
+ 'x:name' => @app_info[:display_name] || @app_info[:name],
117
+ 'x:build' => @app_info[:build],
118
+ 'x:version' => @app_info[:version],
119
+ 'x:changelog' => @changelog,
120
+ 'x:release_type' => @app_info[:release_type],
124
121
  'x:distribution_name' => @app_info[:distribution_name]
125
122
  }
126
123
  end
@@ -130,8 +127,8 @@ module FIR
130
127
 
131
128
  logger.info 'Updating devices info......'
132
129
 
133
- post fir_api[:udids_url], key: @binary_cert[:key],
134
- udids: @app_info[:devices].join(','),
130
+ post fir_api[:udids_url], key: @binary_cert[:key],
131
+ udids: @app_info[:devices].join(','),
135
132
  api_token: @token
136
133
  end
137
134
 
@@ -149,7 +146,7 @@ module FIR
149
146
  logger.info "Fetching #{@app_info[:identifier]}@fir.im uploading info......"
150
147
  logger.info "Uploading app: #{@app_info[:name]}-#{@app_info[:version]}(Build #{@app_info[:build]})"
151
148
 
152
- post fir_api[:app_url], type: @app_info[:type],
149
+ post fir_api[:app_url], type: @app_info[:type],
153
150
  bundle_id: @app_info[:identifier],
154
151
  manual_callback: true,
155
152
  api_token: @token
@@ -172,27 +169,43 @@ module FIR
172
169
 
173
170
  logger_info_blank_line
174
171
 
175
- mapping options[:mappingfile], proj: options[:proj],
176
- build: @app_info[:build],
172
+ mapping options[:mappingfile], proj: options[:proj],
173
+ build: @app_info[:build],
177
174
  version: @app_info[:version],
178
- token: @token
175
+ token: @token
179
176
  end
180
177
 
181
- def logger_info_app_short_and_qrcode
182
- short = "#{fir_api[:domain]}/#{@fir_app_info[:short]}"
178
+ def logger_info_app_short_and_qrcode(options)
179
+ @download_url = "#{fir_api[:domain]}/#{@fir_app_info[:short]}"
180
+ @download_url += "?release_id=#{@app_uploaded_callback_data[:release_id]}" if !!options[:need_release_id]
183
181
 
184
- logger.info "Published succeed: #{short}"
182
+ logger.info "Published succeed: #{@download_url}"
185
183
 
186
- if @export_qrcode
187
- qrcode_path = "#{File.dirname(@file_path)}/fir-#{@app_info[:name]}.png"
188
- FIR.generate_rqrcode(short, qrcode_path)
184
+ @qrcode_path = "#{File.dirname(@file_path)}/fir-#{@app_info[:name]}.png"
185
+ FIR.generate_rqrcode(@qrcode_path, @qrcode_path)
189
186
 
190
- logger.info "Local qrcode file: #{qrcode_path}"
191
- end
187
+ logger.info "Local qrcode file: #{@qrcode_path}" if @export_qrcode
192
188
  end
193
189
 
194
190
  private
195
191
 
192
+ def dingtalk_notifier(options)
193
+ if options[:dingtalk_access_token]
194
+ title = "#{@app_info[:name]}-#{@app_info[:version]}(Build #{@app_info[:build]})"
195
+ payload = {
196
+ "msgtype": 'markdown',
197
+ "markdown": {
198
+ "title": "#{title} uploaded",
199
+ "text": "#{title} uploaded at #{Time.now}\nurl: #{@download_url}\n ![app二维码](data:image/png;base64,#{Base64.strict_encode64(File.read(open(@qrcode_path)))})"
200
+ }
201
+ }
202
+ url = "https://oapi.dingtalk.com/robot/send?access_token=#{options[:dingtalk_access_token]}"
203
+ DefaultRest.post(url, payload)
204
+ end
205
+ rescue StandardError => e
206
+ logger.warn "Dingtalk send error #{e.message}"
207
+ end
208
+
196
209
  def initialize_publish_options(args, options)
197
210
  @file_path = File.absolute_path(args.first.to_s)
198
211
  @file_type = File.extname(@file_path).delete('.')
@@ -206,6 +219,7 @@ module FIR
206
219
 
207
220
  def read_changelog(changelog)
208
221
  return if changelog.blank?
222
+
209
223
  File.exist?(changelog) ? File.read(changelog) : changelog
210
224
  end
211
225
 
@@ -219,7 +233,7 @@ module FIR
219
233
  def convert_icon(origin_path)
220
234
  # 兼容性不太好, 蔽掉转化图标
221
235
  return origin_path
222
-
236
+
223
237
  logger.info "Converting app's icon......"
224
238
 
225
239
  if @app_info[:type] == 'ios'
data/lib/fir/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module FIR
4
- VERSION = '1.7.0'
4
+ VERSION = '1.7.1'
5
5
  end
data/lib/fir.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'thor'
4
- # require 'byebug'
5
4
  require 'logger'
6
5
  require 'yaml'
7
6
  require 'rest-client'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fir-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - NaixSpirit
@@ -9,36 +9,36 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-03-21 00:00:00.000000000 Z
12
+ date: 2019-05-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '1.7'
20
+ version: '0'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "~>"
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '1.7'
27
+ version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - "~>"
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: '10.0'
34
+ version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - "~>"
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: '10.0'
41
+ version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: minitest
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -141,30 +141,16 @@ dependencies:
141
141
  name: api_tools
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- version: '0'
147
- type: :runtime
148
- prerelease: false
149
- version_requirements: !ruby/object:Gem::Requirement
150
- requirements:
151
- - - ">="
152
- - !ruby/object:Gem::Version
153
- version: '0'
154
- - !ruby/object:Gem::Dependency
155
- name: byebug
156
- requirement: !ruby/object:Gem::Requirement
157
- requirements:
158
- - - ">="
144
+ - - "~>"
159
145
  - !ruby/object:Gem::Version
160
- version: '0'
146
+ version: 0.1.0
161
147
  type: :runtime
162
148
  prerelease: false
163
149
  version_requirements: !ruby/object:Gem::Requirement
164
150
  requirements:
165
- - - ">="
151
+ - - "~>"
166
152
  - !ruby/object:Gem::Version
167
- version: '0'
153
+ version: 0.1.0
168
154
  description: fir.im command tool, support iOS and Android
169
155
  email:
170
156
  - atpking@gmail.com
@@ -248,10 +234,10 @@ metadata: {}
248
234
  post_install_message: "\n ______________ ________ ____\n /
249
235
  ____/ _/ __ \\ / ____/ / / _/\n / /_ / // /_/ /_____/ / / / /
250
236
  /\n / __/ _/ // _, _/_____/ /___/ /____/ /\n /_/ /___/_/ |_| \\____/_____/___/\n\n
251
- \ ## 更新记录\n - (1.7.0) 过期了ipa_build 功能, 增加了对 android manifest instant run 的兼容\n
252
- \ - (1.6.13) 上传图标逻辑修改\n - (1.6.12) 修复了部分机器没有默认安装 byebug 的问题\n - (1.6.11) 变化了 ruby
253
- gem 仓库地址\n - [fir-cli](https://github.com/firhq/fir-cli) 已经开源\n - 欢迎 fork, issue
254
- 和 pull request\n "
237
+ \ ## 更新记录\n - (1.7.1) 增加了 钉钉推送 , 增加了返回指定版本下载地址\n - (1.7.0) 过期了ipa_build 功能, 增加了对
238
+ android manifest instant run 的兼容\n - (1.6.13) 上传图标逻辑修改\n - (1.6.12) 修复了部分机器没有默认安装
239
+ byebug 的问题\n - (1.6.11) 变化了 ruby gem 仓库地址\n - [fir-cli](https://github.com/firhq/fir-cli)
240
+ 已经开源\n - 欢迎 fork, issue 和 pull request\n "
255
241
  rdoc_options: []
256
242
  require_paths:
257
243
  - lib
@@ -266,8 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
266
252
  - !ruby/object:Gem::Version
267
253
  version: '0'
268
254
  requirements: []
269
- rubyforge_project:
270
- rubygems_version: 2.7.7
255
+ rubygems_version: 3.0.1
271
256
  signing_key:
272
257
  specification_version: 4
273
258
  summary: fir.im command tool