fir-cli 1.7.2 → 1.7.3

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: 20bfcb3b79089a7e71d3e11863ffcb2d884ba3f28036bd977a869b50a073b243
4
- data.tar.gz: c7f95ac0b0da3915c1f402bd51ea14ae845ffdd018612efa984b16cf40853594
3
+ metadata.gz: f1f3a7635a80250efec2d4872867ac839b285fd92407b445e012a391a34aaaba
4
+ data.tar.gz: e87c109e31952cc513fce2090ad380e9bdfc3856894529bf7c79e08158904542
5
5
  SHA512:
6
- metadata.gz: dce50d46d8fffd9221cee1b291c8f9c4ffe96005d8beb7d3e09564d636ecb0b6260b64e27de805c8d57876cf6ef5e4f1984f9e60424c08e60f48c6529e5ea625
7
- data.tar.gz: 8c1c426413283f1925ef7811793449f2af0b87a661056d6700fc5548dd2d084c6e9bc5282bae4025dee0e580af9aec2d6a75d99ff8a81bc9480d674aabb66aae
6
+ metadata.gz: c01a2a16617b05c2394b001fc992dad32ea0c65b533cc7e8eac75e70f443be1f540ade44c97a0c6218384fed6bf335cff3b07e1baa118c3261fe76f734fa9207
7
+ data.tar.gz: d365066ff94a38ebcce9750f4d1af4754c0ff4e5501daa31ffc85edbc46cda6bad1c859f2e931e56cd7ababffc0266b25a17774515700ded348351c1f3d21203
data/.travis.yml CHANGED
@@ -1,12 +1,7 @@
1
1
  rvm:
2
- - 2.3
3
2
  - 2.4
4
3
  - 2.5
5
4
  - 2.6
6
- - ruby-head
7
- matrix:
8
- allow_failures:
9
- - rvm: ruby-head
10
5
  env:
11
6
  matrix:
12
7
  - USE_OFFICIAL_GEM_SOURCE=true
data/README.md CHANGED
@@ -14,8 +14,11 @@ fir.im-cli 可以通过指令查看, 上传, iOS/Android 应用.
14
14
 
15
15
 
16
16
  # 最近更新
17
+ - publish 支持 新参数 force_pin_history, 可以 将上传的版本, 固定在下载页面上(当大于最大固定版本数后, 会挤掉最老的固定版本)
18
+ - publish 支持 新参数 specify_icon_file_path, 可以直接指定 app 的 icon 图标文件
19
+ - publish 支持 新参数 skip_update_icon, 可以略过更新app图标
17
20
  - 官方支持 钉钉推送, 使用方法为 在publish 中增加 --dingtalk_access_token=xxxxxxxxxxxxxxxxxxx (或者 -D=xxxxxxx) [2019年05月06日]
18
- - 官方支持 上传完毕后, 返回精确的版本的下载地址, 使用方案为 在 publish 后增加 --need_release_id (特定版本支持近期30个以内的任意版本) [2019年05月06日]
21
+ - 官方支持 上传完毕后, 返回精确的版本的下载地址, 使用方案为 在 publish 后增加 --need_release_id (特定版本支持近期30个以内的任意版本. 如有更多历史版本需要回溯, 可向线上客服或者 微信 atpking 进行申请特殊处理某app, 我们会根据使用情况酌情增加) [2019年05月06日]
19
22
  - 已过期 build_ipa 功能, 推荐用户使用 fastlane (fastlane gym)进行打包,生成好 ipa 文件后,再使用 `fir publish` 上传生成的ipa [2019年03月21日]
20
23
  - 由于部分地区上传时遇到的证书问题, 新版本默认忽略证书校验. 如需打开, 请在命令前加入`UPLOAD_VERIFY_SSL=1`
21
24
  - 现已添加 docker 版本, 具体请见 `Docker 运行 fir-cli ` 说明
@@ -61,3 +64,7 @@ fir help
61
64
 
62
65
  - 使用 Github 的 [Issue](https://github.com/FIRHQ/fir-cli/issues)
63
66
 
67
+ ## 特别感谢
68
+
69
+ - 感谢 sparkrico 提供修正的 https://github.com/sparkrico/ruby_apk 解决了 android 解析的问题
70
+
data/fir-cli.gemspec CHANGED
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
27
27
  /_/ /___/_/ |_| \____/_____/___/
28
28
 
29
29
  ## 更新记录
30
+ - (1.7.3) 新增了 上传指定图标, 不上传图标 以及 将版本固定显示在下载页上
30
31
  - (1.7.2) 修正了无论是否加参数都固定出现二维码图片的bug
31
32
  - (1.7.1) 增加了 钉钉推送 , 增加了返回指定版本下载地址
32
33
  - (1.7.0) 过期了ipa_build 功能, 增加了对 android manifest instant run 的兼容
@@ -44,7 +45,7 @@ Gem::Specification.new do |spec|
44
45
 
45
46
  spec.add_dependency 'thor', '~> 0.19'
46
47
  spec.add_dependency 'rest-client', '~> 2.0'
47
- spec.add_dependency 'ruby_android', '~> 0.7.7'
48
+ spec.add_dependency 'ruby_android_apk', '~> 0.7.7.1'
48
49
  spec.add_dependency 'rqrcode', '~> 0.7'
49
50
  spec.add_dependency 'CFPropertyList'
50
51
  spec.add_dependency 'api_tools', '~> 0.1.0'
data/lib/fir/cli.rb CHANGED
@@ -109,6 +109,10 @@ module FIR
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 :force_pin_history, type: :boolean, default: false, desc: 'pin this release to the download page by force'
113
+ method_option :skip_update_icon, type: :boolean, default: false, desc: 'skip update app icon'
114
+ method_option :specify_icon_file, type: :string, desc: 'specify icon file'
115
+
112
116
  method_option :mappingfile, type: :string, aliases: '-m', desc: 'App mapping file'
113
117
  method_option :dingtalk_access_token, type: :string, aliases: '-D', desc: 'Send msg to dingtalk, only need access_token, not whole url'
114
118
 
@@ -163,7 +167,7 @@ module FIR
163
167
  logfile = '/dev/null' if options[:quiet]
164
168
 
165
169
  FIR.logger = Logger.new(logfile)
166
- FIR.logger.level = options[:verbose] ? Logger::INFO : Logger::ERROR
170
+ FIR.logger.level = options[:verbose] ? Logger::DEBUG : Logger::ERROR
167
171
  super
168
172
  end
169
173
  end
@@ -3,22 +3,25 @@ module FIR
3
3
  module Publish
4
4
  def publish(*args, options)
5
5
  initialize_publish_options(args, options)
6
+ @options = options
6
7
  check_supported_file_and_token
7
8
 
8
9
  logger_info_publishing_message
9
10
 
10
11
  @app_info = send("#{@file_type}_info", @file_path, full_info: true)
11
- @user_info = fetch_user_info(@token)
12
+ @user_info = fetch_user_info(@token)
12
13
  @uploading_info = fetch_uploading_info
13
- @app_id = @uploading_info[:id]
14
+ @app_id = @uploading_info[:id]
14
15
 
16
+ logger.info "begin to upload ..."
15
17
  upload_app
18
+ logger.info "end upload "
16
19
 
17
20
  logger_info_dividing_line
18
- logger_info_app_short_and_qrcode(options)
21
+ logger_info_app_short_and_qrcode
19
22
 
20
- dingtalk_notifier(options)
21
- upload_mapping_file_with_publish(options)
23
+ dingtalk_notifier
24
+ upload_mapping_file_with_publish
22
25
  logger_info_blank_line
23
26
  clean_files
24
27
  end
@@ -34,11 +37,20 @@ module FIR
34
37
  end
35
38
 
36
39
  def upload_app
40
+
37
41
  @icon_cert = @uploading_info[:cert][:icon]
38
42
  @binary_cert = @uploading_info[:cert][:binary]
39
-
40
- upload_app_icon unless @app_info[:icons].blank?
43
+ logger.debug "in upload app begin to upload icon"
44
+ upload_app_icon unless @skip_update_icon
45
+ logger.debug "in upload icon finished"
46
+
47
+ logger.debug "in upload app begin to upload binary"
41
48
  @app_uploaded_callback_data = upload_app_binary
49
+ logger.debug "in upload binary"
50
+ @release_id = @app_uploaded_callback_data[:release_id]
51
+
52
+ force_pin_release if @force_pin_history
53
+
42
54
  logger.info "App id is #{@app_id}"
43
55
  logger.info "Release id is #{@app_uploaded_callback_data[:release_id]}"
44
56
  upload_device_info
@@ -62,14 +74,14 @@ module FIR
62
74
  uploaded_info = post(url, info.merge(manual_callback: true),
63
75
  params_to_json: false,
64
76
  header: nil)
65
- rescue StandardError
77
+ rescue StandardError => e
66
78
  logger.error "Uploading app #{postfix} failed"
67
79
  exit 1
68
80
  end
69
81
 
70
82
  def uploading_icon_info
71
83
  large_icon_path = @app_info[:icons].max_by { |f| File.size(f) }
72
- @uncrushed_icon_path = convert_icon(large_icon_path)
84
+ @uncrushed_icon_path = @specify_icon_file_path || convert_icon(large_icon_path)
73
85
  {
74
86
  key: @icon_cert[:key],
75
87
  token: @icon_cert[:token],
@@ -149,6 +161,7 @@ module FIR
149
161
 
150
162
  post fir_api[:app_url], type: @app_info[:type],
151
163
  bundle_id: @app_info[:identifier],
164
+ skip_icon_upload: @options[:skip_update_icon],
152
165
  manual_callback: true,
153
166
  api_token: @token
154
167
  end
@@ -165,7 +178,7 @@ module FIR
165
178
  @fir_app_info
166
179
  end
167
180
 
168
- def upload_mapping_file_with_publish(options)
181
+ def upload_mapping_file_with_publish
169
182
  return if !options[:mappingfile] || !options[:proj]
170
183
 
171
184
  logger_info_blank_line
@@ -176,7 +189,7 @@ module FIR
176
189
  token: @token
177
190
  end
178
191
 
179
- def logger_info_app_short_and_qrcode(options)
192
+ def logger_info_app_short_and_qrcode
180
193
  @download_url = "#{fir_api[:domain]}/#{@fir_app_info[:short]}"
181
194
  @download_url += "?release_id=#{@app_uploaded_callback_data[:release_id]}" if !!options[:need_release_id]
182
195
 
@@ -190,11 +203,20 @@ module FIR
190
203
 
191
204
  private
192
205
 
206
+ def options
207
+ @options
208
+ end
209
+
210
+ def force_pin_release
211
+ post "#{fir_api[:base_url]}/apps/#{@app_id}/releases/#{@release_id}/force_set_history",
212
+ api_token: @token
213
+ end
214
+
193
215
  def clean_files
194
216
  File.delete(@qrcode_path) unless @export_qrcode
195
217
  end
196
218
 
197
- def dingtalk_notifier(options)
219
+ def dingtalk_notifier
198
220
  if options[:dingtalk_access_token]
199
221
  title = "#{@app_info[:name]}-#{@app_info[:version]}(Build #{@app_info[:build]})"
200
222
  payload = {
@@ -220,6 +242,10 @@ module FIR
220
242
  @passwd = options[:password].to_s
221
243
  @is_opened = @passwd.blank? ? options[:open] : false
222
244
  @export_qrcode = !!options[:qrcode]
245
+
246
+ @force_pin_history = options[:force_pin_history]
247
+ @skip_update_icon = options[:skip_update_icon]
248
+ @specify_icon_file_path = File.absolute_path(options[:specify_icon_file]) unless options[:specify_icon_file].blank?
223
249
  end
224
250
 
225
251
  def read_changelog(changelog)
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.2'
4
+ VERSION = '1.7.3'
5
5
  end
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.2
4
+ version: 1.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - NaixSpirit
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-05-16 00:00:00.000000000 Z
12
+ date: 2019-11-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -96,19 +96,19 @@ dependencies:
96
96
  - !ruby/object:Gem::Version
97
97
  version: '2.0'
98
98
  - !ruby/object:Gem::Dependency
99
- name: ruby_android
99
+ name: ruby_android_apk
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: 0.7.7
104
+ version: 0.7.7.1
105
105
  type: :runtime
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: 0.7.7
111
+ version: 0.7.7.1
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: rqrcode
114
114
  requirement: !ruby/object:Gem::Requirement
@@ -234,11 +234,11 @@ metadata: {}
234
234
  post_install_message: "\n ______________ ________ ____\n /
235
235
  ____/ _/ __ \\ / ____/ / / _/\n / /_ / // /_/ /_____/ / / / /
236
236
  /\n / __/ _/ // _, _/_____/ /___/ /____/ /\n /_/ /___/_/ |_| \\____/_____/___/\n\n
237
- \ ## 更新记录\n - (1.7.2) 修正了无论是否加参数都固定出现二维码图片的bug\n - (1.7.1) 增加了 钉钉推送 , 增加了返回指定版本下载地址\n
238
- \ - (1.7.0) 过期了ipa_build 功能, 增加了对 android manifest instant run 的兼容\n - (1.6.13)
239
- 上传图标逻辑修改\n - (1.6.12) 修复了部分机器没有默认安装 byebug 的问题\n - (1.6.11) 变化了 ruby gem 仓库地址\n
240
- \ - [fir-cli](https://github.com/firhq/fir-cli) 已经开源\n - 欢迎 fork, issue 和 pull
241
- request\n "
237
+ \ ## 更新记录\n - (1.7.3) 新增了 上传指定图标, 不上传图标 以及 将版本固定显示在下载页上\n - (1.7.2) 修正了无论是否加参数都固定出现二维码图片的bug\n
238
+ \ - (1.7.1) 增加了 钉钉推送 , 增加了返回指定版本下载地址\n - (1.7.0) 过期了ipa_build 功能, 增加了对 android
239
+ manifest instant run 的兼容\n - (1.6.13) 上传图标逻辑修改\n - (1.6.12) 修复了部分机器没有默认安装 byebug
240
+ 的问题\n - (1.6.11) 变化了 ruby gem 仓库地址\n - [fir-cli](https://github.com/firhq/fir-cli)
241
+ 已经开源\n - 欢迎 fork, issue 和 pull request\n "
242
242
  rdoc_options: []
243
243
  require_paths:
244
244
  - lib
@@ -253,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
253
  - !ruby/object:Gem::Version
254
254
  version: '0'
255
255
  requirements: []
256
- rubygems_version: 3.0.1
256
+ rubygems_version: 3.0.3
257
257
  signing_key:
258
258
  specification_version: 4
259
259
  summary: fir.im command tool