fir-cli 2.0.13 → 2.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/fir-cli.gemspec +1 -0
- data/lib/fir/util/dingtalk_helper.rb +1 -1
- data/lib/fir/util/feishu_helper.rb +2 -1
- data/lib/fir/util/publish.rb +3 -31
- data/lib/fir/util/third_notifier_module.rb +40 -0
- data/lib/fir/version.rb +1 -1
- data/test/test_helper.rb +1 -4
- metadata +18 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ce0252e1ffcd6e9a73ce64fa5359fa06ce77416c93ffd394c6829481956a878
|
4
|
+
data.tar.gz: 5e8443ef24cc7d39aded9bdc1044dd9d8a11452bb081e1023dc9719aed9df0c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19439af4cd18638db3838e157db517e3c2b92045d2c27e269c75ef9eda3dc98b0c79d1d776d72f05ceca466241faefdf8cd242b4a438090019f3420fa9645aa5
|
7
|
+
data.tar.gz: 4c45e66b869e58df20966aae25780612d2c7abd7c5a287547bbe68a09dc1c6773fe4316df00c421d66bd58a08eb87fec985d5aad34a2084d8990da23b5cd5482
|
data/README.md
CHANGED
@@ -13,10 +13,12 @@ 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
|
-
- fir.im
|
16
|
+
- fir.im 更换域名至 betaqr.com 后, 需要升级至 `fir-cli` >= `2.0.4` 有部分用户反馈 2.0.2 无法直接使用 `gem update fir-cli` 升级到 2.0.4, 则可以尝试卸载后重新安装, 即 `gem uninstall fir-cli` 后 `gem install fir-cli`
|
17
17
|
|
18
18
|
|
19
19
|
# 最近更新
|
20
|
+
- (2.0.14) 第三方通知加入了 app 类型, 第三方报错将忽略异常继续运行
|
21
|
+
- (2.0.13) 修正了企业微信通知的bug
|
20
22
|
- (2.0.12) 修复因为钉钉机器人不再支持base64导致无法显示二维码,另外开始支持钉钉加签方式的鉴权, 参数为 --dingtalk_secret
|
21
23
|
- (2.0.11) 兼容了 ruby 3.0
|
22
24
|
- (2.0.10) 飞书支持了 V2 版本的机器人推送
|
data/fir-cli.gemspec
CHANGED
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
/_/ /___/_/ |_| \____/_____/___/
|
28
28
|
|
29
29
|
## 更新记录
|
30
|
+
- (2.0.14) 第三方通知加入了 app 类型, 第三方报错将不再直接报出异常
|
30
31
|
- (2.0.13) 修复了无法跳过企业微信通知逻辑的bug
|
31
32
|
- (2.0.12) 修复因为钉钉机器人不再支持base64导致无法显示二维码,另外开始支持钉钉加签方式的鉴权, 参数为 --dingtalk_secret
|
32
33
|
- (2.0.11) 兼容了 ruby 3.0 版本, 增加了环境变量FEISHU_TIMEOUT,可以多给飞书一些超时时间
|
@@ -20,7 +20,7 @@ class DingtalkHelper
|
|
20
20
|
return if options[:dingtalk_access_token].blank?
|
21
21
|
|
22
22
|
api_domain = @app_info[:api_url]
|
23
|
-
title = "#{@app_info[:name]}-#{@app_info[:version]}(Build #{@app_info[:build]})"
|
23
|
+
title = "#{@app_info[:name]}-#{@app_info[:version]}(Build #{@app_info[:build]}) #{@app_info[:type]}"
|
24
24
|
payload = {
|
25
25
|
"msgtype": 'markdown',
|
26
26
|
"markdown": {
|
@@ -10,7 +10,8 @@ class FeishuHelper
|
|
10
10
|
@feishu_access_token = @options[:feishu_access_token]
|
11
11
|
@qrcode_path = qrcode_path
|
12
12
|
@download_url = download_url
|
13
|
-
|
13
|
+
|
14
|
+
@title = "#{@app_info[:name]}-#{@app_info[:version]}(Build #{@app_info[:build]}) #{@app_info[:type]}"
|
14
15
|
end
|
15
16
|
|
16
17
|
def send_msg
|
data/lib/fir/util/publish.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
# require 'byebug'
|
4
4
|
|
5
|
+
require_relative './third_notifier_module'
|
5
6
|
require_relative './qiniu_uploader'
|
6
7
|
require_relative './ali_uploader'
|
7
8
|
require_relative '../util/feishu_helper'
|
@@ -9,6 +10,7 @@ require_relative '../util/dingtalk_helper'
|
|
9
10
|
|
10
11
|
module FIR
|
11
12
|
module Publish
|
13
|
+
include FIR::ThirdNotifierModule
|
12
14
|
def publish(*args, options)
|
13
15
|
initialize_publish_options(args, options)
|
14
16
|
logger_info_publishing_message
|
@@ -30,9 +32,7 @@ module FIR
|
|
30
32
|
|
31
33
|
qrcode_path = build_qrcode download_url
|
32
34
|
|
33
|
-
|
34
|
-
feishu_notifier(download_url, qrcode_path)
|
35
|
-
wxwork_notifier(download_url)
|
35
|
+
notify_to_thirds(download_url, qrcode_path)
|
36
36
|
|
37
37
|
upload_mapping_file_with_publish
|
38
38
|
|
@@ -195,34 +195,6 @@ module FIR
|
|
195
195
|
api_token: @token
|
196
196
|
end
|
197
197
|
|
198
|
-
def dingtalk_notifier(download_url, qrcode_path)
|
199
|
-
DingtalkHelper.new(@app_info, options, qrcode_path, download_url).send_msg
|
200
|
-
end
|
201
|
-
|
202
|
-
def feishu_notifier(download_url, qrcode_path)
|
203
|
-
FeishuHelper.new(@app_info, options, qrcode_path, download_url).send_msg
|
204
|
-
end
|
205
|
-
|
206
|
-
def wxwork_notifier(download_url)
|
207
|
-
return if options[:wxwork_webhook].blank? && options[:wxwork_access_token].blank?
|
208
|
-
|
209
|
-
webhook_url = options[:wxwork_webhook]
|
210
|
-
webhook_url ||= "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=#{options[:wxwork_access_token]}"
|
211
|
-
|
212
|
-
title = "#{@app_info[:name]}-#{@app_info[:version]}(Build #{@app_info[:build]})"
|
213
|
-
payload = {
|
214
|
-
"msgtype": 'news',
|
215
|
-
"news": {
|
216
|
-
"articles": [{
|
217
|
-
"title": "#{title} uploaded",
|
218
|
-
"description": "#{title} uploaded at #{Time.now}\nurl: #{download_url}\n#{options[:wxwork_custom_message]}\n",
|
219
|
-
"url": download_url,
|
220
|
-
"picurl": options[:wxwork_pic_url]
|
221
|
-
}]
|
222
|
-
}
|
223
|
-
}
|
224
|
-
DefaultRest.post(webhook_url, payload)
|
225
|
-
end
|
226
198
|
|
227
199
|
def initialize_publish_options(args, options)
|
228
200
|
@options = options
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module FIR
|
2
|
+
module ThirdNotifierModule
|
3
|
+
def notify_to_thirds(download_url, qrcode_path)
|
4
|
+
dingtalk_notifier(download_url, qrcode_path)
|
5
|
+
feishu_notifier(download_url, qrcode_path)
|
6
|
+
wxwork_notifier(download_url)
|
7
|
+
rescue => e
|
8
|
+
logger.warn "third notifiers error #{e.message}"
|
9
|
+
end
|
10
|
+
|
11
|
+
def dingtalk_notifier(download_url, qrcode_path)
|
12
|
+
DingtalkHelper.new(@app_info, options, qrcode_path, download_url).send_msg
|
13
|
+
end
|
14
|
+
|
15
|
+
def feishu_notifier(download_url, qrcode_path)
|
16
|
+
FeishuHelper.new(@app_info, options, qrcode_path, download_url).send_msg
|
17
|
+
end
|
18
|
+
|
19
|
+
def wxwork_notifier(download_url)
|
20
|
+
return if options[:wxwork_webhook].blank? && options[:wxwork_access_token].blank?
|
21
|
+
|
22
|
+
webhook_url = options[:wxwork_webhook]
|
23
|
+
webhook_url ||= "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=#{options[:wxwork_access_token]}"
|
24
|
+
|
25
|
+
title = "#{@app_info[:name]}-#{@app_info[:version]}(Build #{@app_info[:build]}) #{@app_info[:type]}"
|
26
|
+
payload = {
|
27
|
+
"msgtype": 'news',
|
28
|
+
"news": {
|
29
|
+
"articles": [{
|
30
|
+
"title": "#{title} uploaded",
|
31
|
+
"description": "#{title} uploaded at #{Time.now}\nurl: #{download_url}\n#{options[:wxwork_custom_message]}\n",
|
32
|
+
"url": download_url,
|
33
|
+
"picurl": options[:wxwork_pic_url]
|
34
|
+
}]
|
35
|
+
}
|
36
|
+
}
|
37
|
+
DefaultRest.post(webhook_url, payload)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/fir/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -1,9 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
# CodeClimate::TestReporter.start
|
4
|
-
require 'codeclimate-test-reporter'
|
5
|
-
require 'simplecov'
|
6
|
-
SimpleCov.start
|
7
4
|
|
8
5
|
|
9
6
|
require 'minitest/autorun'
|
@@ -80,7 +77,7 @@ end
|
|
80
77
|
|
81
78
|
# 跑完测试之后再发结果到Codelimate
|
82
79
|
# 测试CODECLIMATE_REPO_TOKEN: c454b9a54151b3ed3e18949279aec49d6a25bf507706815f99a919f1c01679ed
|
83
|
-
Minitest.after_run do
|
80
|
+
Minitest.after_run do
|
84
81
|
COVERAGE_FILE = "coverage/.resultset.json".freeze
|
85
82
|
if (repo_token = ENV["CODECLIMATE_REPO_TOKEN"]) && !repo_token.empty?
|
86
83
|
if File.exist?(COVERAGE_FILE)
|
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: 2.0.
|
4
|
+
version: 2.0.14
|
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: 2021-
|
12
|
+
date: 2021-06-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -248,6 +248,7 @@ files:
|
|
248
248
|
- lib/fir/util/publish.rb
|
249
249
|
- lib/fir/util/publisher.rb
|
250
250
|
- lib/fir/util/qiniu_uploader.rb
|
251
|
+
- lib/fir/util/third_notifier_module.rb
|
251
252
|
- lib/fir/version.rb
|
252
253
|
- lib/fir/xcode_wrapper.sh
|
253
254
|
- lib/fir_cli.rb
|
@@ -270,20 +271,21 @@ metadata: {}
|
|
270
271
|
post_install_message: "\n ______________ ________ ____\n /
|
271
272
|
____/ _/ __ \\ / ____/ / / _/\n / /_ / // /_/ /_____/ / / / /
|
272
273
|
/\n / __/ _/ // _, _/_____/ /___/ /____/ /\n /_/ /___/_/ |_| \\____/_____/___/\n\n
|
273
|
-
\ ## 更新记录\n - (2.0.
|
274
|
-
|
275
|
-
\ - (2.0.
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
274
|
+
\ ## 更新记录\n - (2.0.14) 第三方通知加入了 app 类型, 第三方报错将不再直接报出异常\n - (2.0.13) 修复了无法跳过企业微信通知逻辑的bug\n
|
275
|
+
\ - (2.0.12) 修复因为钉钉机器人不再支持base64导致无法显示二维码,另外开始支持钉钉加签方式的鉴权, 参数为 --dingtalk_secret\n
|
276
|
+
\ - (2.0.11) 兼容了 ruby 3.0 版本, 增加了环境变量FEISHU_TIMEOUT,可以多给飞书一些超时时间\n - (2.0.10) 飞书支持了
|
277
|
+
V2 版本的机器人推送\n - (2.0.9) publish 支持了 企业微信通知 可以使用 --wxwork_access_token 或 --wxwork_webhook,
|
278
|
+
增加了回调超时时间至20秒\n - (2.0.8) publish 支持 飞书通知, 可使用 `feishu_access_token` 和 `feishu_custom_message`,
|
279
|
+
详情见 `fir publish --help`\n - (2.0.7) 修复了提示 token 有问题的错误\n - (2.0.6) 将校验文件是否存在提前\n
|
280
|
+
\ - (2.0.5) 更换了上传域名, 避免与 深信服的设备冲突\n - (2.0.4) 修复了 cdn 不支持 patch 方法透传, 导致在修改 app
|
281
|
+
信息的时候返回的 400 错误\n - (2.0.3) 增加 dingtalk_at_phones, 钉钉通知可 at 用户手机号, 以逗号,分割. 此命令需配合
|
282
|
+
`dingtalk_access_token` 使用\n - (2.0.3) 增加 dingtalk_at_all, 钉钉通知可 at 所有人, 此命令需配合
|
283
|
+
`dingtalk_access_token` 使用\n - (2.0.3) publish 增加海外加速参数 --oversea_turbo\n - (2.0.2)
|
284
|
+
有限支持 aab 文件上传, 强依赖`bundletool`工具, 具体请参见参数 `--bundletool_jar_path` 和 `auto_download_bundletool_jar`\n
|
285
|
+
\ - (2.0.1) publish 支持 新参数 `specify_app_display_name`, 指定 app 显示名称\n - (2.0.1)
|
286
|
+
publish 支持 新参数 `need_ansi_qrcode`, 在控制台直接打印二维码, jenkins 用户可能需要使用 `AnsiColor Plugin`
|
287
|
+
插件配合\n - (2.0.1) publish 支持 新参数 `dingtalk_custom_message`, 可以在钉钉通知里增加自定义消息, 此命令需配合
|
288
|
+
`dingtalk_access_token` 使用\n - (2.0.1) publish 支持 新参数 `skip_fir_cli_feedback`,
|
287
289
|
可禁止 fir-cli 发送统计信息\n - (2.0.0) publish 使用更快的存储商, 加速上传速度, 若感觉没以前可使用 switch_to_qiniu
|
288
290
|
恢复\n - [fir-cli](https://github.com/firhq/fir-cli) 已经开源\n - 欢迎 fork, issue 和 pull
|
289
291
|
request\n "
|