fastlane-plugin-pgyer_jvtd 0.1.7 → 0.1.8
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddeefc67253d08bd64d8c8f496dd6706902e43deabaff6f33f8d74101c13f9a9
|
4
|
+
data.tar.gz: 53eb5767b449aeddb0249ff4fa375780f2f52f1c437cd72a132cb82185789824
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fce83201a7774248a5abaf1eb3d9af6378f2256375135077ed1bd2ef240a8ce36f8ec38892cddcd490bf10f544b4c120760aaea78587c13141a45c0aeda787b9
|
7
|
+
data.tar.gz: b35785e288b6f7a5ea530507e76b86b20adfd6f019c44c7060e0543eb94d70e46a5c2100eb5d10ebebc46020ee81b783acf9501ff7ae55fc3603e77e5c702695
|
@@ -10,16 +10,16 @@ module Fastlane
|
|
10
10
|
api_host = "http://qiniu-storage.pgyer.com/apiv1/app/upload"
|
11
11
|
api_key = params[:api_key]
|
12
12
|
user_key = params[:user_key]
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
access_token = params[:dingtalk_access_token]
|
14
|
+
is_at_all = params[:is_at_all]
|
15
|
+
|
16
|
+
if is_at_all.nil?
|
17
|
+
is_at_all = "0"
|
18
|
+
end
|
19
19
|
|
20
20
|
build_file = [
|
21
|
-
|
22
|
-
|
21
|
+
params[:ipa],
|
22
|
+
params[:apk]
|
23
23
|
].detect { |e| !e.to_s.empty? }
|
24
24
|
|
25
25
|
if build_file.nil?
|
@@ -42,7 +42,7 @@ module Fastlane
|
|
42
42
|
if install_type.nil?
|
43
43
|
install_type = "1"
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
46
|
channel_shortcut = params[:channel_shortcut]
|
47
47
|
if channel_shortcut.nil?
|
48
48
|
channel_shortcut = ""
|
@@ -50,10 +50,10 @@ module Fastlane
|
|
50
50
|
|
51
51
|
# start upload
|
52
52
|
conn_options = {
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
53
|
+
request: {
|
54
|
+
timeout: 1000,
|
55
|
+
open_timeout: 300
|
56
|
+
}
|
57
57
|
}
|
58
58
|
|
59
59
|
pgyer_client = Faraday.new(nil, conn_options) do |c|
|
@@ -80,86 +80,87 @@ module Fastlane
|
|
80
80
|
|
81
81
|
if info['code'] != 0
|
82
82
|
UI.user_error!("PGYER Plugin Error: #{info['message']}")
|
83
|
+
return
|
83
84
|
end
|
84
85
|
|
85
86
|
UI.success "Upload success. Visit this URL to see: https://www.pgyer.com/#{info['data']['appShortcutUrl']}"
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
87
|
+
|
88
|
+
|
89
|
+
# 应用类型
|
90
|
+
appType = "Android";
|
91
|
+
if info['data']['appType'] == 1
|
92
|
+
appType = "iOS"
|
93
|
+
end
|
94
|
+
|
95
|
+
# 应用名称
|
96
|
+
appName = info['data']['appName']
|
97
|
+
# 应用版本信息
|
98
|
+
appVersion = info['data']['appVersion']
|
99
|
+
# 应用蒲公英版本
|
100
|
+
appBuildVersion = info['data']['appBuildVersion']
|
101
|
+
# 图标
|
102
|
+
appIcon = "https://appicon.pgyer.com/image/view/app_icons/#{info['data']['appIcon']}"
|
103
|
+
# 地址
|
104
|
+
appUrl = "https://www.pgyer.com/#{info['data']['appShortcutUrl']}"
|
105
|
+
|
106
|
+
unless access_token.nil?
|
107
|
+
uri = URI.parse("https://oapi.dingtalk.com/robot/send?access_token=#{access_token}")
|
108
|
+
|
109
|
+
dingtalk_client = Faraday.new(nil, conn_options) do |c|
|
110
|
+
c.request :multipart
|
111
|
+
c.request :url_encoded
|
112
|
+
c.response :json, content_type: /\bjson$/
|
113
|
+
c.adapter :net_http
|
114
|
+
end
|
115
|
+
|
116
|
+
params = {
|
117
|
+
"msgtype" => "link",
|
118
|
+
"link" => {
|
119
|
+
"text" => "#{appName}#{appType} App发布",
|
120
|
+
"title" => "请下载最新版本#{appVersion}(#{appBuildVersion})",
|
121
|
+
"picUrl" => appIcon,
|
122
|
+
"messageUrl" => appUrl
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
|
127
|
+
response = dingtalk_client.post uri, params
|
128
|
+
info = response.body
|
129
|
+
|
130
|
+
if info['errcode'] != 0
|
131
|
+
UI.error('ding talk error message: ' + info["errmsg"])
|
132
|
+
end
|
133
|
+
|
134
|
+
dingtalk2_client = Faraday.new(nil, conn_options) do |c|
|
135
|
+
c.request :multipart
|
136
|
+
c.request :url_encoded
|
137
|
+
c.response :json, content_type: /\bjson$/
|
138
|
+
c.adapter :net_http
|
139
|
+
end
|
140
|
+
|
141
|
+
params = {
|
142
|
+
"msgtype" => "text",
|
143
|
+
"text" => {
|
144
|
+
"content" => "#{appName}#{appType} App最新版本已发布"
|
145
|
+
},
|
146
|
+
"at" => {
|
147
|
+
"atMobiles" => [],
|
148
|
+
"isAtAll" => is_at_all == "1"
|
149
|
+
}
|
150
|
+
}
|
151
|
+
|
152
|
+
|
153
|
+
response = dingtalk2_client.post uri, params
|
154
|
+
info = response.body
|
155
|
+
|
156
|
+
if info['errcode'] != 0
|
157
|
+
UI.error('ding talk error message: ' + info["errmsg"])
|
158
|
+
end
|
159
|
+
|
160
|
+
UI.success("Successfully send qr code to ding talk!")
|
161
|
+
else
|
162
|
+
end
|
163
|
+
|
163
164
|
end
|
164
165
|
|
165
166
|
def self.description
|
@@ -181,70 +182,70 @@ module Fastlane
|
|
181
182
|
|
182
183
|
def self.available_options
|
183
184
|
[
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
185
|
+
FastlaneCore::ConfigItem.new(key: :api_key,
|
186
|
+
env_name: "PGYER_API_KEY",
|
187
|
+
description: "api_key in your pgyer account",
|
188
|
+
optional: false,
|
189
|
+
type: String),
|
190
|
+
FastlaneCore::ConfigItem.new(key: :user_key,
|
191
|
+
env_name: "PGYER_USER_KEY",
|
192
|
+
description: "user_key in your pgyer account",
|
193
|
+
optional: false,
|
194
|
+
type: String),
|
195
|
+
FastlaneCore::ConfigItem.new(key: :apk,
|
196
|
+
env_name: "PGYER_APK",
|
197
|
+
description: "Path to your APK file",
|
198
|
+
default_value: Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH],
|
199
|
+
optional: true,
|
200
|
+
verify_block: proc do |value|
|
201
|
+
UI.user_error!("Couldn't find apk file at path '#{value}'") unless File.exist?(value)
|
202
|
+
end,
|
203
|
+
conflicting_options: [:ipa],
|
204
|
+
conflict_block: proc do |value|
|
205
|
+
UI.user_error!("You can't use 'apk' and '#{value.key}' options in one run")
|
206
|
+
end),
|
207
|
+
FastlaneCore::ConfigItem.new(key: :ipa,
|
208
|
+
env_name: "PGYER_IPA",
|
209
|
+
description: "Path to your IPA file. Optional if you use the _gym_ or _xcodebuild_ action. For Mac zip the .app. For Android provide path to .apk file",
|
210
|
+
default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
|
211
|
+
optional: true,
|
212
|
+
verify_block: proc do |value|
|
213
|
+
UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value)
|
214
|
+
end,
|
215
|
+
conflicting_options: [:apk],
|
216
|
+
conflict_block: proc do |value|
|
217
|
+
UI.user_error!("You can't use 'ipa' and '#{value.key}' options in one run")
|
218
|
+
end),
|
219
|
+
FastlaneCore::ConfigItem.new(key: :password,
|
220
|
+
env_name: "PGYER_PASSWORD",
|
221
|
+
description: "set password to protect app",
|
222
|
+
optional: true,
|
223
|
+
type: String),
|
224
|
+
FastlaneCore::ConfigItem.new(key: :update_description,
|
225
|
+
env_name: "PGYER_UPDATE_DESCRIPTION",
|
226
|
+
description: "set update description for app",
|
227
|
+
optional: true,
|
228
|
+
type: String),
|
229
|
+
FastlaneCore::ConfigItem.new(key: :install_type,
|
230
|
+
env_name: "PGYER_INSTALL_TYPE",
|
231
|
+
description: "set install type for app (1=public, 2=password, 3=invite). Please set as a string",
|
232
|
+
optional: true,
|
233
|
+
type: String),
|
234
|
+
FastlaneCore::ConfigItem.new(key: :channel_shortcut,
|
235
|
+
env_name: "PGYER_CHANNEL",
|
236
|
+
description: "Use channel short link. Please set as a string",
|
237
|
+
optional: true,
|
238
|
+
type: String),
|
239
|
+
FastlaneCore::ConfigItem.new(key: :dingtalk_access_token,
|
240
|
+
env_name: "DINGTALK_ACCESS_TOKEN",
|
241
|
+
description: "Set up webhook and push update messages. Please set as a string",
|
242
|
+
optional: true,
|
243
|
+
type: String),
|
244
|
+
FastlaneCore::ConfigItem.new(key: :is_at_all,
|
245
|
+
env_name: "DINGTALK_IS_AT_ALL",
|
246
|
+
description: "set is at all for dingtalk (0=not_all, 1=all). Please set as a string",
|
247
|
+
optional: true,
|
248
|
+
type: String)
|
248
249
|
]
|
249
250
|
end
|
250
251
|
|