fastlane-plugin-pgyer_jvtd 0.1.9 → 0.2.0
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: 46c1860890a0a9b95e9244dfd105dcfd0ba618117050f6504ca96b318d6e9d13
|
4
|
+
data.tar.gz: 9534c55c8abaf7b7239450b66026700ed9a54a5dc24a775b781820829ba5dfb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b859df1e456ae380e4749a6894c82ea011c57668916d45de35621bcd41f951da8ea0c6da2e6cfd59c105782c24c5cb1e7f114d990f68013fbd0d0c526c31990c
|
7
|
+
data.tar.gz: 40ad9e907d84af31a1b65300c46753e4d35f4087e81b7549465a7390825b0e22f18020dbc3758a78be40f77dea37154e7fd727ca96335dff8562a11ae6572328
|
@@ -17,75 +17,78 @@ module Fastlane
|
|
17
17
|
is_at_all = "0"
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
params[:ipa],
|
22
|
-
params[:apk]
|
23
|
-
].detect { |e| !e.to_s.empty? }
|
20
|
+
info = nil
|
24
21
|
|
25
|
-
if
|
26
|
-
|
27
|
-
|
22
|
+
if api_key.nil?
|
23
|
+
build_file = [
|
24
|
+
params[:ipa],
|
25
|
+
params[:apk]
|
26
|
+
].detect { |e| !e.to_s.empty? }
|
28
27
|
|
29
|
-
|
28
|
+
if build_file.nil?
|
29
|
+
UI.user_error!("You have to provide a build file")
|
30
|
+
end
|
30
31
|
|
31
|
-
|
32
|
-
if password.nil?
|
33
|
-
password = ""
|
34
|
-
end
|
32
|
+
UI.message "build_file: #{build_file}"
|
35
33
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
password = params[:password]
|
35
|
+
if password.nil?
|
36
|
+
password = ""
|
37
|
+
end
|
40
38
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
39
|
+
update_description = params[:update_description]
|
40
|
+
if update_description.nil?
|
41
|
+
update_description = ""
|
42
|
+
end
|
45
43
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
44
|
+
install_type = params[:install_type]
|
45
|
+
if install_type.nil?
|
46
|
+
install_type = "1"
|
47
|
+
end
|
50
48
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
open_timeout: 300
|
56
|
-
}
|
57
|
-
}
|
58
|
-
|
59
|
-
pgyer_client = Faraday.new(nil, conn_options) do |c|
|
60
|
-
c.request :multipart
|
61
|
-
c.request :url_encoded
|
62
|
-
c.response :json, content_type: /\bjson$/
|
63
|
-
c.adapter :net_http
|
64
|
-
end
|
49
|
+
channel_shortcut = params[:channel_shortcut]
|
50
|
+
if channel_shortcut.nil?
|
51
|
+
channel_shortcut = ""
|
52
|
+
end
|
65
53
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
'file' => Faraday::UploadIO.new(build_file, 'application/octet-stream')
|
74
|
-
}
|
54
|
+
# start upload
|
55
|
+
conn_options = {
|
56
|
+
request: {
|
57
|
+
timeout: 1000,
|
58
|
+
open_timeout: 300
|
59
|
+
}
|
60
|
+
}
|
75
61
|
|
76
|
-
|
62
|
+
pgyer_client = Faraday.new(nil, conn_options) do |c|
|
63
|
+
c.request :multipart
|
64
|
+
c.request :url_encoded
|
65
|
+
c.response :json, content_type: /\bjson$/
|
66
|
+
c.adapter :net_http
|
67
|
+
end
|
77
68
|
|
78
|
-
|
79
|
-
|
69
|
+
params = {
|
70
|
+
'_api_key' => api_key,
|
71
|
+
'uKey' => user_key,
|
72
|
+
'password' => password,
|
73
|
+
'updateDescription' => update_description,
|
74
|
+
'installType' => install_type,
|
75
|
+
'channelShortcut' => channel_shortcut,
|
76
|
+
'file' => Faraday::UploadIO.new(build_file, 'application/octet-stream')
|
77
|
+
}
|
80
78
|
|
81
|
-
|
82
|
-
UI.user_error!("PGYER Plugin Error: #{info['message']}")
|
83
|
-
return
|
84
|
-
end
|
79
|
+
UI.message "Start upload #{build_file} to pgyer..."
|
85
80
|
|
86
|
-
|
81
|
+
response = pgyer_client.post api_host, params
|
82
|
+
info = response.body
|
87
83
|
|
84
|
+
if info['code'] != 0
|
85
|
+
UI.user_error!("PGYER Plugin Error: #{info['message']}")
|
86
|
+
return
|
87
|
+
end
|
88
88
|
|
89
|
+
UI.success "Upload success. Visit this URL to see: https://www.pgyer.com/#{info['data']['appShortcutUrl']}"
|
90
|
+
else
|
91
|
+
end
|
89
92
|
# 应用类型
|
90
93
|
appType = "Android";
|
91
94
|
if info['data']['appType'] == 1
|
@@ -94,22 +97,37 @@ module Fastlane
|
|
94
97
|
|
95
98
|
# 应用名称
|
96
99
|
appName = info['data']['appName']
|
100
|
+
if appName.nil?
|
101
|
+
appName = "测试应用"
|
102
|
+
end
|
97
103
|
# 应用版本信息
|
98
104
|
appVersion = info['data']['appVersion']
|
105
|
+
if appVersion.nil?
|
106
|
+
appVersion = "1.0.0"
|
107
|
+
end
|
99
108
|
# 应用蒲公英版本
|
100
109
|
appBuildVersion = info['data']['appBuildVersion']
|
110
|
+
if appBuildVersion.nil?
|
111
|
+
appBuildVersion = 1
|
112
|
+
end
|
101
113
|
# 图标
|
102
114
|
appIcon = "https://appicon.pgyer.com/image/view/app_icons/#{info['data']['appIcon']}"
|
115
|
+
if appIcon.nil?
|
116
|
+
appIcon = ""
|
117
|
+
end
|
103
118
|
# 地址
|
104
119
|
appUrl = "https://www.pgyer.com/#{info['data']['appShortcutUrl']}"
|
120
|
+
if appUrl.nil?
|
121
|
+
appUrl = "https://www.pgyer.com"
|
122
|
+
end
|
105
123
|
|
106
124
|
unless access_token.nil?
|
107
|
-
|
108
|
-
|
125
|
+
uriStr = "https://oapi.dingtalk.com/robot/send?access_token=#{access_token}";
|
126
|
+
uri = URI.parse(uriStr)
|
127
|
+
UI.success uriStr
|
109
128
|
dingtalk_client = Faraday.new(nil, conn_options) do |c|
|
110
129
|
c.request :url_encoded
|
111
130
|
c.response :json, content_type: /\bjson$/
|
112
|
-
c.adapter :net_http
|
113
131
|
end
|
114
132
|
|
115
133
|
params = {
|
@@ -132,7 +150,6 @@ module Fastlane
|
|
132
150
|
dingtalk2_client = Faraday.new(nil, conn_options) do |c|
|
133
151
|
c.request :url_encoded
|
134
152
|
c.response :json, content_type: /\bjson$/
|
135
|
-
c.adapter :net_http
|
136
153
|
end
|
137
154
|
|
138
155
|
params = {
|