fastlane-plugin-codemagic 0.1.0 → 0.1.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41bf6b2f4a394b0416d71f1000001b97d1edb9a8516315edf1f2352b8adf00de
|
4
|
+
data.tar.gz: 45ab5013021f80a0a9e37a76a3243499911cb985a66d7c1694b5eedf6e9ad1bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 612c5778ba9c3b3b5f8c68bc240c8ab8b9212a5290b73609c9eee4375442d488d0f324f605f6af7a9bdf1ee630c021394d03a990d19937afefcd3ed0410be3e4
|
7
|
+
data.tar.gz: '00856876a693bb53a9862c9d3c7b988715ba7d4318aa0d5c362cf604b6f6562a0bddd67d33331bf4b88de94cae5ff86de66936bbe5fc8c8ca168cbc8e18b95bc'
|
@@ -25,8 +25,7 @@ module Fastlane
|
|
25
25
|
last_build_id = get_last_build_id(params[:auth_token], params[:app_id])
|
26
26
|
|
27
27
|
build = check_building_status(params[:auth_token], last_build_id)
|
28
|
-
|
29
|
-
if build_path != nil
|
28
|
+
unless build_path.nil?
|
30
29
|
download_artefacts(download_artefacts, build, build_path)
|
31
30
|
end
|
32
31
|
end
|
@@ -77,7 +76,6 @@ module Fastlane
|
|
77
76
|
hide_keys: [],
|
78
77
|
title: "Codemagic API response")
|
79
78
|
end
|
80
|
-
|
81
79
|
end
|
82
80
|
|
83
81
|
def self.get_last_build_id(auth_token, app_id)
|
@@ -103,32 +101,33 @@ module Fastlane
|
|
103
101
|
hide_keys: [],
|
104
102
|
title: "Codemagic API response")
|
105
103
|
end
|
106
|
-
|
107
104
|
end
|
108
105
|
|
109
106
|
def self.check_building_status(auth_token, build_id)
|
110
|
-
|
107
|
+
prev_build_status = ''
|
108
|
+
loop do
|
111
109
|
build = get_build(auth_token, build_id)
|
112
110
|
build_status = build["status"]
|
113
111
|
|
114
112
|
case build_status
|
115
113
|
when "failed"
|
116
114
|
UI.abort_with_message!(build["message"])
|
117
|
-
when "success"
|
118
|
-
when "finished"
|
115
|
+
when "success", "finished"
|
119
116
|
UI.success("Success")
|
117
|
+
return build
|
120
118
|
else
|
121
|
-
|
122
|
-
|
119
|
+
if prev_build_status != build_status
|
120
|
+
UI.message("Status: #{build_status}")
|
121
|
+
end
|
122
|
+
prev_build_status = build_status
|
123
|
+
sleep(10)
|
123
124
|
next
|
124
125
|
end
|
125
|
-
build
|
126
126
|
break
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
130
130
|
def self.get_build(auth_token, build_id)
|
131
|
-
UI.message("Requesting codemagic.io API...")
|
132
131
|
uri = URI.parse("https://api.codemagic.io/builds/#{build_id}")
|
133
132
|
https = Net::HTTP.new(uri.host, uri.port)
|
134
133
|
https.use_ssl = true
|
@@ -142,11 +141,6 @@ module Fastlane
|
|
142
141
|
json_response = JSON.parse(response.body)
|
143
142
|
|
144
143
|
if response.code == "200"
|
145
|
-
|
146
|
-
UI.success("Build triggered successfully on Codemagic.io 🚀")
|
147
|
-
FastlaneCore::PrintTable.print_values(config: json_response["build"],
|
148
|
-
hide_keys: [],
|
149
|
-
title: "Build")
|
150
144
|
json_response["build"]
|
151
145
|
else
|
152
146
|
UI.user_error!("Couln't trigger the build on Codemagic.io.")
|
@@ -158,27 +152,22 @@ module Fastlane
|
|
158
152
|
|
159
153
|
def self.download_artefacts(download_artefacts, build, build_path)
|
160
154
|
UI.message("Download artefacts codemagic.io API...")
|
161
|
-
artefacts = build["artefacts"]
|
162
155
|
|
163
|
-
|
156
|
+
artefacts = build["artefacts"]
|
164
157
|
|
165
|
-
real_build_dir = File.expand_path(
|
158
|
+
real_build_dir = File.expand_path(build_path)
|
166
159
|
|
167
160
|
if Dir.exist?(real_build_dir)
|
168
161
|
|
169
162
|
artefacts.map do |artefact|
|
163
|
+
next unless download_artefacts.include?(artefact["type"]) || download_artefacts == 'all'
|
170
164
|
|
171
|
-
|
165
|
+
UI.message("Download #{artefact['type']} [#{artefact['size']}]: #{artefact['url']}")
|
172
166
|
|
173
|
-
|
174
|
-
hide_keys: [])
|
175
|
-
|
176
|
-
real_build_path = File.expand_path("#{build_path}#{artefact["name"]}")
|
177
|
-
|
178
|
-
open(real_build_path, 'wb') do |file|
|
179
|
-
file << open(artefact["url"]).read
|
180
|
-
end
|
167
|
+
real_build_path = File.expand_path("#{build_path}#{artefact['name']}")
|
181
168
|
|
169
|
+
open(real_build_path, 'wb') do |file|
|
170
|
+
file << open(artefact["url"]).read
|
182
171
|
end
|
183
172
|
end
|
184
173
|
else
|
@@ -205,55 +194,54 @@ module Fastlane
|
|
205
194
|
|
206
195
|
def self.available_options
|
207
196
|
[
|
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
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
197
|
+
FastlaneCore::ConfigItem.new(key: :app_id,
|
198
|
+
env_name: "CODEMAGIC_APP_ID",
|
199
|
+
description: "Codemagic application identifier",
|
200
|
+
optional: false,
|
201
|
+
type: String,
|
202
|
+
verify_block: proc do |value|
|
203
|
+
UI.user_error!("No Codemagic application ID given, pass it using `app_id` parameter to the Codemagic plugin.") unless value && !value.empty?
|
204
|
+
end),
|
205
|
+
|
206
|
+
FastlaneCore::ConfigItem.new(key: :workflow_id,
|
207
|
+
env_name: "CODEMAGIC_WORKFLOW_ID",
|
208
|
+
description: "Codemagic workflow identifier as specified in YAML file",
|
209
|
+
optional: false,
|
210
|
+
type: String,
|
211
|
+
verify_block: proc do |value|
|
212
|
+
UI.user_error!("No Codemagic workflow ID given, pass it using `workflow_id` parameter to the Codemagic plugin.") unless value && !value.empty?
|
213
|
+
end),
|
214
|
+
|
215
|
+
FastlaneCore::ConfigItem.new(key: :auth_token,
|
216
|
+
env_name: "CODEMAGIC_AUTH_TOKEN",
|
217
|
+
description: "Codemagic Auth Token",
|
218
|
+
optional: false,
|
219
|
+
type: String,
|
220
|
+
verify_block: proc do |value|
|
221
|
+
UI.user_error!("No Codemagic auth token given, pass it using `auth_token` parameter to the Codemagic plugin.") unless value && !value.empty?
|
222
|
+
end),
|
223
|
+
|
224
|
+
FastlaneCore::ConfigItem.new(key: :branch,
|
225
|
+
env_name: "CODEMAGIC_BRANCH",
|
226
|
+
description: "Codemagic branch name",
|
227
|
+
optional: false,
|
228
|
+
type: String,
|
229
|
+
verify_block: proc do |value|
|
230
|
+
UI.user_error!("No Codemagic branch given, pass it using `branch` parameter to the Codemagic plugin.") unless value && !value.empty?
|
231
|
+
end),
|
232
|
+
|
233
|
+
FastlaneCore::ConfigItem.new(key: :download,
|
234
|
+
description: "Download Codemagic artefacts",
|
235
|
+
optional: true,
|
236
|
+
type: Object),
|
237
|
+
|
238
|
+
FastlaneCore::ConfigItem.new(key: :environment,
|
239
|
+
description: "Codemagic Specify environment variables and software versions to override values defined in workflow settings",
|
240
|
+
optional: true,
|
241
|
+
type: Object)
|
253
242
|
]
|
254
243
|
end
|
255
244
|
|
256
|
-
|
257
245
|
def self.is_supported?(platform)
|
258
246
|
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
259
247
|
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-codemagic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikhail Matsera
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|