fir-cli 2.0.5 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff49f78b68df2b899a2cf22047765b0228c982dfbee1e49bec4f889eed3ac44f
4
- data.tar.gz: 1919e46e442aac9547c98245d7a04866cd628d2dc61b04124cd62b33ad653c19
3
+ metadata.gz: 5acdeeb7784c5b2236e79e1831fc58a1fb0590ec8297eaf958e78a9c19c1274a
4
+ data.tar.gz: 7941c08d66ca7fc14fc273ca4ed66033e23995103d6dceb754bf58b7240bba3c
5
5
  SHA512:
6
- metadata.gz: c1dd3424f0ac0b4ec286000b0ad4072935b9e3289daaaef2674df23a0ae27a4602a6ae9ae7473e0a14f30f8bf821a783b18ddecb561843f9439233ee293b068c
7
- data.tar.gz: 3dc653d533cc66d43e77674249a1c0e04f9b801a07be8e8821bad65f1da04e78ffebe9950b292b82abb0d6eadbff6a8455a66cc32a2649e781e6669927440f9f
6
+ metadata.gz: 8f0919f278f6be3e872c176065097b9a5b406e441c529bdfed2b06825f0b027c8ed44d165ea11f66d4cf80afa210395f1ac3cf3909aeb326b76cc4a919694a79
7
+ data.tar.gz: ff1b2ff17df4b917759a600ac1932af2d9412117570efab0c6624f9e70a2e250d66f550db9e6695a0a7109ecc407ced75976d9384381f753c076bca65e292cb7
data/README.md CHANGED
@@ -13,11 +13,15 @@ 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 更换域名后, 需要升级至 fir-cli >=2.0.4 有部分用户反馈 2.0.2 无法升级到2.0.4, 则可以尝试卸载后重新安装 `gem uninstall fir-cli` 后 `gem install fir-cli`
17
- - 深信服 的 上网行为管理AC 的域名黑名单误将 api.bq04.com 加入了黑名单, 我们已经联系了 深信服, 他们的回答是 `收到!已反馈!预计在3月17日左右的规则库更新,辛苦当时暂时需要使用的话先临时放通下,等规则库更新及时使用设备联网更新最新的规则库,有什么疑问您在及时反馈,感谢您的支持。
18
- ` 我们也会临时切换 fir-cli version 2.0.5 的 api 地址
16
+ - fir.im 更换域名后, 需要升级至 `fir-cli` >= `2.0.4` 有部分用户反馈 2.0.2 无法直接使用 `gem update fir-cli` 升级到 2.0.4, 则可以尝试卸载后重新安装, 即 `gem uninstall fir-cli` 后 `gem install fir-cli`
17
+
19
18
 
20
19
  # 最近更新
20
+ - (2.0.10) 飞书支持了 V2 版本的机器人推送
21
+ - (2.0.9) publish 支持了 企业微信通知 可以使用 --wxwork_access_token 或 --wxwork_webhook, 增加了回调超时时间至20秒
22
+ - (2.0.8) publish 支持 飞书通知, 可使用 `feishu_access_token` 和 `feishu_custom_message`, 详情见 `fir publish --help`
23
+ - (2.0.7) 修复了提示 token 错误的问题
24
+ - (2.0.6) 修复了因为文件读取方式变化而导致的文件找不到不报错的问题
21
25
  - (2.0.5) 因为深信服 的黑名单误判, 将 api 切换到了备用域名
22
26
  - (2.0.4) 修复了 cdn 不支持 patch 方法透传, 导致在修改 app 信息的时候返回的 400 错误
23
27
  - (2.0.3.3) 试图打印出错的body内容
@@ -43,24 +47,49 @@ fir.im-cli 可以通过指令查看, 上传, iOS/Android 应用.
43
47
 
44
48
  ## 热门问题
45
49
 
50
+ ### 啥是 钉钉 / 企业微信 / 飞书 的 `access_token` ?
51
+
52
+ 就是回调地址中的长得最像 access_token 的东西
53
+
54
+ ```
55
+ 钉钉: https://oapi.dingtalk.com/robot/send?access_token=xxxxx
56
+ 就是 xxx 那部分
57
+
58
+ 企业微信: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxx-xxxx-xxxx-xxxx-xxxxx
59
+ 就是 xxxxx-xxxx-xxxx-xxxx-xxxxx 那部分
60
+
61
+ https://open.feishu.cn/open-apis/bot/hook/xxxxxxxxxxxxxxxxxxx
62
+
63
+ 就是 xxxxxxxxxxxxxxxx 那部分
64
+
65
+ ```
66
+
67
+
68
+
69
+
70
+
46
71
  ### 如何配合 jenkins 使用?
47
72
 
48
73
  参见 blog [http://blog.betaqr.com/use-fir-cli-in-jenkins/](http://blog.betaqr.com/use-fir-cli-in-jenkins/)
49
74
 
50
- ### Circle CI, Travis CI 或 Github Actions 等境外服务上, 有概率超时, 能否解决?
75
+ 这里有个快速检查脚本, 可以在 jenkins 中新建一个 脚本, 进行检查
51
76
 
52
- 2.0.3 版本 及其以上, 可以申请海外加速内测资格, 开启后可以使用海外加速上传
77
+ ```
78
+ #!/bin/bash --login
53
79
 
80
+ rvm list # 确保 rvm 正确安装, 如果直接通过系统安装ruby, 可以注释此行
81
+ ruby -v # 查看 ruby 的版本, 请确保大于 2.4.0
82
+ gem install fir-cli # 现场安装fir-cli , 如果安装过, 则会略过
83
+ fir -v # 查看 fir-cli 的版本
54
84
 
55
- 由于监管要求, 我们必须将服务于存储放置在境内. 由于众所周知的原因, 国内外连通性的表现不太好, 虽然我们的存储服务商 阿里云 提供了 OSS 境外加速服务, 但是高达 1.25 元/GB 的传输成本确实我们也没办法负担.
85
+ # 在这里执行 fir publish xxxxx
86
+ ```
56
87
 
57
88
 
89
+ ### 在 Circle CI, Travis CI 或 Github Actions 等境外服务上, 有概率超时, 能否解决?
58
90
 
59
- 目前我们提供三种临时解决方案来缓解问题(2.0.2以下版本):
91
+ 2.0.3 版本 及其以上, 可以申请海外加速内测资格, 开启后可以使用海外加速上传 `--oversea_turbo`
60
92
 
61
- 1. 设置较长的超时时间 如 `FIR_TIMEOUT=300 fir publish xxxx`, 则可将超时时间设置为 300 秒.
62
- 2. 如果fir-cli 版本 >= 2.0.0, 也可在出现超时后, 使用 `--switch-to-qiniu` 来切换到我们的另外一条存储线路. 如 `fir publish xxxx.apk --switch-to-qiniu`, 多一条线路备选.
63
- 3. 如果确实对这方面服务要求很高, 则可购买我们的私有部署服务. 我们可以在 aws 上部署一套专供您使用, 具体情况可以与客服或者加我微信进行沟通.
64
93
 
65
94
  更多细节请参考 [https://github.com/FIRHQ/fir-cli/issues/260](https://github.com/FIRHQ/fir-cli/issues/260)
66
95
 
@@ -138,10 +167,8 @@ docker run -e API_TOKEN=您的token -v 您的上传文件的目录的绝对路
138
167
  ## 特别感谢
139
168
 
140
169
  - 感谢 sparkrico 提供修正的 https://github.com/sparkrico/ruby_apk 解决了 android 解析的问题
141
-
170
+ - 感谢 fabcz 同学对企业微信的通知的支持 https://github.com/FIRHQ/fir-cli/pull/277
142
171
 
143
172
  ## 鼓励维护
144
173
 
145
- 感谢支持
146
-
147
- ![luckin](luckin_coffee.png)
174
+ hia~ hia~ hia~
@@ -3,33 +3,56 @@
3
3
  `fir publish` 命令用于可以发布应用到 fir.im, 支持 ipa 和 apk 文件.
4
4
 
5
5
  ```sh
6
- $ fir publish --help
7
6
  Usage:
8
7
  fir publish APP_FILE_PATH
9
8
 
10
9
  Options:
11
- -s, [--short=SHORT] # Set custom short link
12
- -c, [--changelog=CHANGELOG] # Set changelog
13
- -Q, [--qrcode], [--no-qrcode] # Generate qrcode
14
- [--open], [--no-open] # true/false if open for everyone
15
- [--password=PASSWORD] # Set password for app
16
- -T, [--token=TOKEN] # User's API Token at fir.im
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
20
- -V, [--verbose], [--no-verbose] # Show verbose
21
- # Default: true
22
- -q, [--quiet], [--no-quiet] # Silence commands
23
- -h, [--help], [--no-help] # Show this help message and quit
10
+ -s, [--short=SHORT] # 设置short
11
+ -c, [--changelog=CHANGELOG] # 设置更新内容, 可是文件地址也可直接是内容
12
+ -Q, [--qrcode], [--no-qrcode] # 生成二维码图片在当前目录
13
+ [--need-ansi-qrcode], [--no-need-ansi-qrcode] #
14
+ -R, [--need-release-id], [--no-need-release-id] # 在下载地址中包含具体版本(警告, 每个app 最多保留30个版本, 超过后会失效最老的版本)
15
+ -H, [--force-pin-history], [--no-force-pin-history] # 将版本留在下载页(即在新版本上传后, 下面仍然有旧版本的二维码可以引导)
16
+ -S, [--skip-update-icon], [--no-skip-update-icon] # 跳过更新图标
17
+ [--specify-icon-file=SPECIFY_ICON_FILE] # 指定更新图标
18
+ [--skip-fir-cli-feedback], [--no-skip-fir-cli-feedback] # 跳过 用来做统计fir-cli的反馈(用于改进fir-cli)
19
+ [--specify-app-display-name=SPECIFY_APP_DISPLAY_NAME] # 指定app 名称
20
+ -N, [--switch-to-qiniu], [--no-switch-to-qiniu] # 切换到七牛线路上传(当上传较慢时, 可试试这个)
21
+ [--oversea-turbo], [--no-oversea-turbo] # 海外加速(需联系微信 atpking 开通)
22
+ -m, [--mappingfile=MAPPINGFILE] # mappingfile
23
+ -D, [--dingtalk-access-token=DINGTALK_ACCESS_TOKEN] # 上传完毕后 若发送至钉钉, 则填写钉钉的webhook 的access_token
24
+ [--dingtalk-custom-message=DINGTALK_CUSTOM_MESSAGE] # 自定义钉钉消息 (针对钉钉新版webhook 需要校验的时候, 可以做关键字)
25
+ [--dingtalk-at-phones=DINGTALK_AT_PHONES] # 钉钉 at 某人手机号
26
+ [--dingtalk-at-all], [--no-dingtalk-at-all]
27
+ [--feishu-access-token=FEISHU_ACCESS_TOKEN] # 飞书的webhook 的access_token
28
+ [--feishu-custom-message=FEISHU_CUSTOM_MESSAGE] # 自定义飞书消息
29
+ [--wxwork-webhook=WXWORK_WEBHOOK] # 企业微信的 webhook 地址 (注意这里与 access_token 只需要填写一个参数即可)
30
+ [--wxwork-access-token=WXWORK_ACCESS_TOKEN] # 企业微信的 webhook access_token (注意这里与 access_token 只需要填写一个参数即可)
31
+ [--wxwork-custom-message=WXWORK_CUSTOM_MESSAGE] # 企业微信 的自定义消息
32
+ [--wxwork-pic-url=WXWORK_PIC_URL] # 企业微信的图片链接, best size is 1068x455
33
+ [--open], [--no-open] # 是否下载可见, 默认open
34
+ [--password=PASSWORD] # 下载页面密码, 默认为空
35
+ [--bundletool-jar-path=BUNDLETOOL_JAR_PATH] # (beta) 上传AAB 文件的特殊指令: upload aab file command: to specify bundletool.jar if command bundletool can not run directly
36
+ [--auto-download-bundletool-jar], [--no-auto-download-bundletool-jar] # (beta) 上传AAB 文件的特殊指令: upload aab file command: would download bundletool when invoke bundletool failure
37
+ -T, [--token=TOKEN] # betaqr.com(fir.im) 账户的 API_TOKEN
38
+ -L, [--logfile=LOGFILE] # Path to writable logfile
39
+ -V, [--verbose], [--no-verbose] # Show verbose
40
+ # Default: true
41
+ -q, [--quiet], [--no-quiet] # Silence commands
42
+ -h, [--help], [--no-help] # Show this help message and quit
43
+
44
+ Description:
45
+ `publish` command will publish your app file to fir.im, also the command support to publish app's short & changelog.
46
+
47
+ Example:
48
+
49
+ $ fir p <app file path> [-c <changelog> -s <custom short link> -Q -T <your api token>]
50
+
51
+ $ fir p <app file path> [-c <changelog> -s <custom short link> --password=123456 --open=false -Q -T <your api token>]
52
+
53
+ $ fir p <app file path> [-c <changelog> -s <custom short link> -m <mapping file path> -P <bughd project id> -Q -T <your
54
+ api token>]
24
55
  ```
25
56
 
26
- 相关参数详解:
27
57
 
28
- - `-s` 参数, 自定义发布后的短链接地址.
29
- - `-c` 参数, 自定义发布时的 changelog, 支持字符串与文件两种方式, 即 `--changelog='this is changelog'` 和 `--changelog='/Users/fir-cli/changelog'`.
30
- - `-Q` 参数, 是否生成发布后二维码, 默认为不生成, 加上 `-Q` 参数后会在当前目录生成一张二维码图片, 扫描该图片即可下载该应用.
31
- - `-R` 参数, 显示具体版本, 会在发布结束后的下载地址中生成指定的版本
32
- - `-D` 参数, 钉钉机器人的access_token, 填写后当上传完毕, 会发送至钉钉机器人
33
- - `--open` 参数, 设置发布后的应用是否开放给所有人下载, 关闭开放使用 `--no-open` 参数.
34
- - `--password` 参数, 设置发布后的应用密码
35
58
 
@@ -27,6 +27,12 @@ Gem::Specification.new do |spec|
27
27
  /_/ /___/_/ |_| \____/_____/___/
28
28
 
29
29
  ## 更新记录
30
+ - (2.0.10) 飞书支持了 V2 版本的机器人推送
31
+ - (2.0.9) publish 支持了 企业微信通知 可以使用 --wxwork_access_token 或 --wxwork_webhook, 增加了回调超时时间至20秒
32
+ - (2.0.8) publish 支持 飞书通知, 可使用 `feishu_access_token` 和 `feishu_custom_message`, 详情见 `fir publish --help`
33
+ - (2.0.7) 修复了提示 token 有问题的错误
34
+ - (2.0.6) 将校验文件是否存在提前
35
+ - (2.0.5) 更换了上传域名, 避免与 深信服的设备冲突
30
36
  - (2.0.4) 修复了 cdn 不支持 patch 方法透传, 导致在修改 app 信息的时候返回的 400 错误
31
37
  - (2.0.3) 增加 dingtalk_at_phones, 钉钉通知可 at 用户手机号, 以逗号,分割. 此命令需配合 `dingtalk_access_token` 使用
32
38
  - (2.0.3) 增加 dingtalk_at_all, 钉钉通知可 at 所有人, 此命令需配合 `dingtalk_access_token` 使用
@@ -2,6 +2,7 @@ fir:
2
2
  domain: 'http://www.betaqr.com'
3
3
  base_url: 'http://fir-api.admqr.com'
4
4
  user_url: 'http://fir-api.admqr.com/user'
5
+ user_feishu_access_token: 'http://fir-api.admqr.com/user/fetch_feishu_v3_token'
5
6
  app_url: 'http://fir-api.admqr.com/apps'
6
7
  udids_url: 'http://fir-api.admqr.com/devices/multi_udid'
7
8
 
@@ -127,6 +127,14 @@ module FIR
127
127
  method_option :dingtalk_at_phones, type: :string, desc: 'at some phones, split by , eg: 13111111111,13111111112'
128
128
  method_option :dingtalk_at_all, type: :boolean, default: false
129
129
 
130
+ method_option :feishu_access_token, type: :string, desc: 'Send msg to feishu, need access_token, not whole url'
131
+ method_option :feishu_custom_message, type: :string, desc: 'add custom message to feishu'
132
+
133
+ method_option :wxwork_webhook, type: :string, desc: 'wxwork webhook url (optional)'
134
+ method_option :wxwork_access_token, type: :string, desc: 'Send msg to wxwork group, need group bot webhook, not whole url'
135
+ method_option :wxwork_custom_message, type: :string, desc: 'add custom message to wxwork group'
136
+ method_option :wxwork_pic_url, type: :string, desc: 'message background image, best size is 1068x455'
137
+
130
138
  method_option :open, type: :boolean, desc: 'true/false if open for everyone'
131
139
  method_option :password, type: :string, desc: 'Set password for app'
132
140
 
@@ -44,7 +44,7 @@ module FIR
44
44
  def check_file_exist(path)
45
45
  return if File.file?(path)
46
46
 
47
- logger.error 'File does not exist'
47
+ logger.error "File does not exist: #{path}"
48
48
  exit 1
49
49
  end
50
50
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module FIR
2
4
  class AppUploader
3
5
  include ApiTools::DefaultRestModule
@@ -14,6 +16,8 @@ module FIR
14
16
  def upload
15
17
  upload_icon
16
18
  binary_callback_info = upload_binary
19
+ raise binary_callback_info if binary_callback_info.is_a? StandardError
20
+
17
21
  # 将 binary 的callback信息返回
18
22
  binary_callback_info
19
23
  end
@@ -21,9 +25,12 @@ module FIR
21
25
  protected
22
26
 
23
27
  def callback_to_api(callback_url, callback_binary_information)
28
+ logger.debug 'begin to callback api'
24
29
  return if callback_binary_information.blank?
25
30
 
26
- post callback_url, callback_binary_information
31
+ answer = post callback_url, callback_binary_information, timeout: 20
32
+ logger.debug 'callback api finished'
33
+ answer
27
34
  end
28
35
 
29
36
  def icon_file_path
@@ -74,6 +81,7 @@ module FIR
74
81
 
75
82
  def callback_icon_information
76
83
  return {} if icon_file_path.nil?
84
+
77
85
  {
78
86
  key: icon_cert[:key],
79
87
  token: icon_cert[:token],
@@ -106,6 +114,5 @@ module FIR
106
114
  def logger
107
115
  FIR.logger
108
116
  end
109
-
110
117
  end
111
- end
118
+ end
@@ -0,0 +1,94 @@
1
+ require 'json'
2
+ # require 'byebug'
3
+ class FeishuHelper
4
+ attr_accessor :app_info, :options, :feishu_access_token, :qrcode_path, :image_key, :download_url, :title
5
+ include FIR::Config
6
+
7
+ def initialize(app_info, options, qrcode_path, download_url)
8
+ @app_info = app_info
9
+ @options = options
10
+ @feishu_access_token = @options[:feishu_access_token]
11
+ @qrcode_path = qrcode_path
12
+ @download_url = download_url
13
+ @title = "#{@app_info[:name]}-#{@app_info[:version]}(Build #{@app_info[:build]})"
14
+ end
15
+
16
+ def send_msg
17
+ return if feishu_access_token.blank?
18
+
19
+ answer = v2_request
20
+ v1_request if answer.dig('ok') == 'false'
21
+ end
22
+
23
+ def v2_request
24
+ url = "https://open.feishu.cn/open-apis/bot/v2/hook/#{feishu_access_token}"
25
+ x = build_v2_info
26
+ DefaultRest.post(url, x)
27
+ end
28
+
29
+ def v1_request
30
+ url = "https://open.feishu.cn/open-apis/bot/hook/#{feishu_access_token}"
31
+ payload = {
32
+ "title": "#{title} uploaded",
33
+ "text": "#{title} uploaded at #{Time.now}\nurl: #{download_url}\n#{options[:feishu_custom_message]}\n"
34
+ }
35
+ DefaultRest.post(url, payload)
36
+ end
37
+
38
+ private
39
+
40
+ def build_v2_info
41
+ {
42
+ msg_type: 'post',
43
+ content: {
44
+ post: {
45
+ zh_cn: {
46
+ title: title,
47
+ content: [build_info_tags, [build_image_tag]]
48
+ }
49
+ }
50
+ }
51
+ }
52
+ end
53
+
54
+ def build_info_tags
55
+ text = "#{title} uploaded at #{Time.now}\n#{options[:feishu_custom_message]}\n"
56
+ [
57
+ {
58
+ "tag": 'text',
59
+ "text": text
60
+ },
61
+ {
62
+ "tag": 'a',
63
+ "text": download_url,
64
+ "href": download_url
65
+ }
66
+ ]
67
+ end
68
+
69
+ def build_image_tag
70
+ {
71
+ "tag": 'img',
72
+ "image_key": upload_qr_code,
73
+ "width": 300,
74
+ "height": 300
75
+ }
76
+ end
77
+
78
+ def fetch_image_access_token
79
+ answer = DefaultRest.post(fir_api[:fetch_feishu_v3_token] || 'http://fir-api.admqr.com/user/fetch_feishu_v3_token', {})
80
+ answer[:feishu_v3_token]
81
+ end
82
+
83
+ def upload_qr_code
84
+ answer = RestClient.post('https://open.feishu.cn/open-apis/image/v4/put/', {
85
+ image_type: 'message',
86
+ image: File.new(qrcode_path, 'rb')
87
+ }, {
88
+ 'Authorization' => "Bearer #{fetch_image_access_token}"
89
+ })
90
+
91
+ json = JSON.parse(answer)
92
+ json.dig('data', 'image_key')
93
+ end
94
+ end
@@ -3,12 +3,12 @@
3
3
  # require 'byebug'
4
4
  require_relative './qiniu_uploader'
5
5
  require_relative './ali_uploader'
6
+ require_relative '../util/feishu_helper'
6
7
 
7
8
  module FIR
8
9
  module Publish
9
10
  def publish(*args, options)
10
11
  initialize_publish_options(args, options)
11
- check_supported_file_and_token
12
12
  logger_info_publishing_message
13
13
 
14
14
  logger.info 'begin to upload ...'
@@ -26,7 +26,11 @@ module FIR
26
26
  logger.info "Published succeed: #{download_url}"
27
27
 
28
28
  qrcode_path = build_qrcode download_url
29
+
29
30
  dingtalk_notifier(download_url, qrcode_path)
31
+ feishu_notifier(download_url, qrcode_path)
32
+ wxwork_notifier(download_url)
33
+
30
34
  upload_mapping_file_with_publish
31
35
 
32
36
  upload_fir_cli_usage_info(received_app_info)
@@ -213,11 +217,41 @@ module FIR
213
217
  logger.warn "Dingtalk send error #{e.message}"
214
218
  end
215
219
 
220
+ def feishu_notifier(download_url, qrcode_path)
221
+ FeishuHelper.new(@app_info, options, qrcode_path, download_url).send_msg
222
+ end
223
+
224
+ def wxwork_notifier(download_url)
225
+ webhook_url = options[:wxwork_webhook]
226
+ webhook_url ||= "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=#{options[:wxwork_access_token]}"
227
+ return if webhook_url.blank?
228
+
229
+ title = "#{@app_info[:name]}-#{@app_info[:version]}(Build #{@app_info[:build]})"
230
+ payload = {
231
+ "msgtype": "news",
232
+ "news": {
233
+ "articles": [{
234
+ "title": "#{title} uploaded",
235
+ "description": "#{title} uploaded at #{Time.now}\nurl: #{download_url}\n#{options[:wxwork_custom_message]}\n",
236
+ "url": download_url,
237
+ "picurl": options[:wxwork_pic_url]
238
+ }],
239
+ },
240
+ }
241
+ DefaultRest.post(webhook_url, payload)
242
+ end
243
+
216
244
  def initialize_publish_options(args, options)
217
245
  @options = options
218
246
  @file_path = File.absolute_path(args.first.to_s)
219
247
  @file_type = File.extname(@file_path).delete('.')
248
+
249
+ check_file_exist(@file_path)
250
+ check_supported_file(@file_path)
251
+
220
252
  @token = options[:token] || current_token
253
+ check_token_cannot_be_blank(@token)
254
+
221
255
  @changelog = read_changelog(options[:changelog]).to_s.to_utf8
222
256
  @short = options[:short].to_s
223
257
  @passwd = options[:password].to_s
@@ -241,12 +275,7 @@ module FIR
241
275
  File.exist?(changelog) ? File.read(changelog) : changelog
242
276
  end
243
277
 
244
- def check_supported_file_and_token
245
- check_file_exist(@file_path)
246
- check_supported_file(@file_path)
247
- check_token_cannot_be_blank(@token)
248
- fetch_user_info(@token)
249
- end
278
+
250
279
 
251
280
  def build_dingtalk_at_info(payload)
252
281
  answer = {}
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module FIR
4
- VERSION = '2.0.5'
4
+ VERSION = '2.0.10'
5
5
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fir-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - NaixSpirit
8
8
  - atpking
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-03-07 00:00:00.000000000 Z
12
+ date: 2020-10-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -218,6 +218,7 @@ files:
218
218
  - lib/fir/util/build_common.rb
219
219
  - lib/fir/util/build_ipa.rb
220
220
  - lib/fir/util/config.rb
221
+ - lib/fir/util/feishu_helper.rb
221
222
  - lib/fir/util/http.rb
222
223
  - lib/fir/util/info.rb
223
224
  - lib/fir/util/login.rb
@@ -254,17 +255,21 @@ metadata: {}
254
255
  post_install_message: "\n ______________ ________ ____\n /
255
256
  ____/ _/ __ \\ / ____/ / / _/\n / /_ / // /_/ /_____/ / / / /
256
257
  /\n / __/ _/ // _, _/_____/ /___/ /____/ /\n /_/ /___/_/ |_| \\____/_____/___/\n\n
257
- \ ## 更新记录\n - (2.0.4) 修复了 cdn 不支持 patch 方法透传, 导致在修改 app 信息的时候返回的 400 错误\n - (2.0.3)
258
- 增加 dingtalk_at_phones, 钉钉通知可 at 用户手机号, 以逗号,分割. 此命令需配合 `dingtalk_access_token` 使用\n
259
- \ - (2.0.3) 增加 dingtalk_at_all, 钉钉通知可 at 所有人, 此命令需配合 `dingtalk_access_token` 使用\n
260
- \ - (2.0.3) publish 增加海外加速参数 --oversea_turbo\n - (2.0.2) 有限支持 aab 文件上传, 强依赖`bundletool`工具,
261
- 具体请参见参数 `--bundletool_jar_path` `auto_download_bundletool_jar`\n - (2.0.1) publish
262
- 支持 新参数 `specify_app_display_name`, 指定 app 显示名称\n - (2.0.1) publish 支持 新参数 `need_ansi_qrcode`,
263
- 在控制台直接打印二维码, jenkins 用户可能需要使用 `AnsiColor Plugin` 插件配合\n - (2.0.1) publish 支持 新参数
264
- `dingtalk_custom_message`, 可以在钉钉通知里增加自定义消息, 此命令需配合 `dingtalk_access_token` 使用\n
265
- \ - (2.0.1) publish 支持 新参数 `skip_fir_cli_feedback`, 可禁止 fir-cli 发送统计信息\n - (2.0.0)
266
- publish 使用更快的存储商, 加速上传速度, 若感觉没以前可使用 switch_to_qiniu 恢复\n - [fir-cli](https://github.com/firhq/fir-cli)
267
- 已经开源\n - 欢迎 fork, issue pull request\n "
258
+ \ ## 更新记录\n - (2.0.10) 飞书支持了 V2 版本的机器人推送\n - (2.0.9) publish 支持了 企业微信通知 可以使用 --wxwork_access_token
259
+ --wxwork_webhook, 增加了回调超时时间至20秒\n - (2.0.8) publish 支持 飞书通知, 可使用 `feishu_access_token`
260
+ `feishu_custom_message`, 详情见 `fir publish --help`\n - (2.0.7) 修复了提示 token 有问题的错误\n
261
+ \ - (2.0.6) 将校验文件是否存在提前\n - (2.0.5) 更换了上传域名, 避免与 深信服的设备冲突\n - (2.0.4) 修复了 cdn
262
+ 不支持 patch 方法透传, 导致在修改 app 信息的时候返回的 400 错误\n - (2.0.3) 增加 dingtalk_at_phones, 钉钉通知可
263
+ at 用户手机号, 以逗号,分割. 此命令需配合 `dingtalk_access_token` 使用\n - (2.0.3) 增加 dingtalk_at_all,
264
+ 钉钉通知可 at 所有人, 此命令需配合 `dingtalk_access_token` 使用\n - (2.0.3) publish 增加海外加速参数 --oversea_turbo\n
265
+ \ - (2.0.2) 有限支持 aab 文件上传, 强依赖`bundletool`工具, 具体请参见参数 `--bundletool_jar_path`
266
+ `auto_download_bundletool_jar`\n - (2.0.1) publish 支持 新参数 `specify_app_display_name`,
267
+ 指定 app 显示名称\n - (2.0.1) publish 支持 新参数 `need_ansi_qrcode`, 在控制台直接打印二维码, jenkins
268
+ 用户可能需要使用 `AnsiColor Plugin` 插件配合\n - (2.0.1) publish 支持 新参数 `dingtalk_custom_message`,
269
+ 可以在钉钉通知里增加自定义消息, 此命令需配合 `dingtalk_access_token` 使用\n - (2.0.1) publish 支持 新参数 `skip_fir_cli_feedback`,
270
+ 可禁止 fir-cli 发送统计信息\n - (2.0.0) publish 使用更快的存储商, 加速上传速度, 若感觉没以前可使用 switch_to_qiniu
271
+ 恢复\n - [fir-cli](https://github.com/firhq/fir-cli) 已经开源\n - 欢迎 fork, issue 和 pull
272
+ request\n "
268
273
  rdoc_options: []
269
274
  require_paths:
270
275
  - lib
@@ -280,7 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
285
  version: '0'
281
286
  requirements: []
282
287
  rubygems_version: 3.0.3
283
- signing_key:
288
+ signing_key:
284
289
  specification_version: 4
285
290
  summary: fir.im command tool
286
291
  test_files: