fastlane-plugin-buildstash 1.0.4 → 1.0.5
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: 8bfcbd7c42d466d7ce7473ecde4ad46672b6aef591efcfa2d878b87826fa83ce
|
|
4
|
+
data.tar.gz: 8bc9609e34d2a2eeb99520e18ca77be3cd534437f28ac27870aed81884b507cd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3bdc357c0afa825c7f2207335ff50d0541b6177ed2f4b98df10c1d2427e9f2967398ec6c702d2d1c6a8d7850c09f50b59f116087b34c8f6007f7fa05e889f943
|
|
7
|
+
data.tar.gz: e2735c380bd3783d33c7c92e4476a2ef3f7a9c8b4d1f1ea43d5948338ffbd6765a3db6ea306b6eb07b14316838d10789aac8b00258b3d3ac9044979d56fafec3
|
data/README.md
CHANGED
|
@@ -114,7 +114,7 @@ buildstash_upload(
|
|
|
114
114
|
| `api_key` | The API key for authentication | ✅ |
|
|
115
115
|
| `structure` | 'file' for single file, 'file+expansion' to include Android expansion file. will default to 'file' | ✖ |
|
|
116
116
|
| `primary_file_path` | './path/to/file.apk' | ✅ |
|
|
117
|
-
| `platform` | 'android' or 'ios' (see [Buildstash docs for full list](https://docs.buildstash.com/
|
|
117
|
+
| `platform` | 'android' or 'ios' (see [Buildstash docs for full list](https://docs.buildstash.com/api/data/platforms)) | ✅ |
|
|
118
118
|
| `custom_target` | Custom target for this build — must exactly match a target defined in your Buildstash app | ✖️ |
|
|
119
119
|
| `stream` | Exact name of a build stream in your app | ✅ |
|
|
120
120
|
| `version_component_1_major` | Semantic version (major component) | ✅ |
|
|
@@ -140,6 +140,7 @@ buildstash_upload(
|
|
|
140
140
|
| `vc_branch` | Branch name (if applicable) | ✖️ |
|
|
141
141
|
| `vc_commit_sha` | Commit SHA (if applicable) | ✖️ |
|
|
142
142
|
| `vc_commit_url` | Commit URL | ✖️ |
|
|
143
|
+
| `ssl_verify` | Set to `false` to disable SSL certificate verification. Only use this if your CI runner has SSL issues (e.g. unable to verify certificate CRL). Defaults to `true` | ✖️ |
|
|
143
144
|
|
|
144
145
|
|
|
145
146
|
## Example Output
|
|
@@ -40,6 +40,7 @@ module Fastlane
|
|
|
40
40
|
vc_commit_url = params[:vc_commit_url]
|
|
41
41
|
|
|
42
42
|
metadata_artifacts = params[:metadata_artifacts] || []
|
|
43
|
+
ssl_verify = params[:ssl_verify]
|
|
43
44
|
|
|
44
45
|
if !structure
|
|
45
46
|
structure = "file"
|
|
@@ -117,7 +118,8 @@ module Fastlane
|
|
|
117
118
|
"Authorization" => "Bearer #{api_key}",
|
|
118
119
|
"Content-Type" => "application/json",
|
|
119
120
|
"Accept" => "application/json"
|
|
120
|
-
}
|
|
121
|
+
},
|
|
122
|
+
ssl_verify: ssl_verify
|
|
121
123
|
)
|
|
122
124
|
|
|
123
125
|
unless response.is_a?(Net::HTTPSuccess)
|
|
@@ -152,7 +154,8 @@ module Fastlane
|
|
|
152
154
|
chunk_count: primary_file["chunked_number_parts"],
|
|
153
155
|
chunk_size_mb: primary_file["chunked_part_size_mb"],
|
|
154
156
|
api_key: api_key,
|
|
155
|
-
is_expansion: false
|
|
157
|
+
is_expansion: false,
|
|
158
|
+
ssl_verify: ssl_verify
|
|
156
159
|
)
|
|
157
160
|
|
|
158
161
|
UI.verbose("primary_file_parts=#{primary_file_parts}");
|
|
@@ -167,7 +170,8 @@ module Fastlane
|
|
|
167
170
|
"x-amz-acl": "private",
|
|
168
171
|
"Content-Type" => primary_file["presigned_data"]["headers"]["Content-Type"],
|
|
169
172
|
"Content-Length" => file_size.to_s
|
|
170
|
-
}
|
|
173
|
+
},
|
|
174
|
+
ssl_verify: ssl_verify
|
|
171
175
|
)
|
|
172
176
|
|
|
173
177
|
unless response.is_a?(Net::HTTPSuccess)
|
|
@@ -196,7 +200,8 @@ module Fastlane
|
|
|
196
200
|
chunk_count: expansion_info["chunked_number_parts"],
|
|
197
201
|
chunk_size_mb: expansion_info["chunked_part_size_mb"],
|
|
198
202
|
api_key: params[:api_key],
|
|
199
|
-
is_expansion: true
|
|
203
|
+
is_expansion: true,
|
|
204
|
+
ssl_verify: ssl_verify
|
|
200
205
|
)
|
|
201
206
|
|
|
202
207
|
# Store this info for later if needed
|
|
@@ -214,7 +219,8 @@ module Fastlane
|
|
|
214
219
|
"Content-Length" => expansion_info["presigned_data"]["headers"]["Content-Length"].to_s,
|
|
215
220
|
"Content-Disposition" => expansion_info["presigned_data"]["headers"]["Content-Disposition"],
|
|
216
221
|
"x-amz-acl" => "private"
|
|
217
|
-
}
|
|
222
|
+
},
|
|
223
|
+
ssl_verify: ssl_verify
|
|
218
224
|
)
|
|
219
225
|
|
|
220
226
|
unless response.is_a?(Net::HTTPSuccess)
|
|
@@ -248,7 +254,9 @@ module Fastlane
|
|
|
248
254
|
"Authorization" => "Bearer #{api_key}",
|
|
249
255
|
"Content-Type" => "application/json",
|
|
250
256
|
"Accept" => "application/json"
|
|
251
|
-
}
|
|
257
|
+
},
|
|
258
|
+
ssl_verify: ssl_verify
|
|
259
|
+
)
|
|
252
260
|
|
|
253
261
|
unless response.is_a?(Net::HTTPSuccess)
|
|
254
262
|
UI.error("Buildstash API returned #{response.code}: #{response.body}")
|
|
@@ -279,12 +287,13 @@ module Fastlane
|
|
|
279
287
|
upload_metadata_artifacts(
|
|
280
288
|
metadata_artifacts: metadata_artifacts,
|
|
281
289
|
pending_upload_id: pending_upload_id,
|
|
282
|
-
api_key: api_key
|
|
290
|
+
api_key: api_key,
|
|
291
|
+
ssl_verify: ssl_verify
|
|
283
292
|
)
|
|
284
293
|
end
|
|
285
294
|
end
|
|
286
295
|
|
|
287
|
-
def self.upload_metadata_artifacts(metadata_artifacts:, pending_upload_id:, api_key:)
|
|
296
|
+
def self.upload_metadata_artifacts(metadata_artifacts:, pending_upload_id:, api_key:, ssl_verify: true)
|
|
288
297
|
max_files = 10
|
|
289
298
|
max_size_bytes = 5 * 1024 * 1024
|
|
290
299
|
|
|
@@ -334,7 +343,8 @@ module Fastlane
|
|
|
334
343
|
"Authorization" => "Bearer #{api_key}",
|
|
335
344
|
"Content-Type" => "application/json",
|
|
336
345
|
"Accept" => "application/json"
|
|
337
|
-
}
|
|
346
|
+
},
|
|
347
|
+
ssl_verify: ssl_verify
|
|
338
348
|
)
|
|
339
349
|
|
|
340
350
|
unless meta_request_response.is_a?(Net::HTTPSuccess)
|
|
@@ -362,7 +372,8 @@ module Fastlane
|
|
|
362
372
|
"Content-Length" => (upload_headers["Content-Length"] || file_size).to_s,
|
|
363
373
|
"Content-Disposition" => upload_headers["Content-Disposition"] || "attachment; filename=\"#{filename}\"",
|
|
364
374
|
"x-amz-acl" => "private"
|
|
365
|
-
}
|
|
375
|
+
},
|
|
376
|
+
ssl_verify: ssl_verify
|
|
366
377
|
)
|
|
367
378
|
|
|
368
379
|
unless upload_response.is_a?(Net::HTTPSuccess)
|
|
@@ -381,7 +392,8 @@ module Fastlane
|
|
|
381
392
|
"Authorization" => "Bearer #{api_key}",
|
|
382
393
|
"Content-Type" => "application/json",
|
|
383
394
|
"Accept" => "application/json"
|
|
384
|
-
}
|
|
395
|
+
},
|
|
396
|
+
ssl_verify: ssl_verify
|
|
385
397
|
)
|
|
386
398
|
|
|
387
399
|
unless meta_verify_response.is_a?(Net::HTTPSuccess)
|
|
@@ -611,6 +623,14 @@ module Fastlane
|
|
|
611
623
|
default_value: []
|
|
612
624
|
),
|
|
613
625
|
|
|
626
|
+
FastlaneCore::ConfigItem.new(
|
|
627
|
+
key: :ssl_verify,
|
|
628
|
+
description: "Set to false to disable SSL certificate verification. Only use this if your CI runner has SSL issues (e.g. unable to verify certificate CRL)",
|
|
629
|
+
optional: true,
|
|
630
|
+
type: :boolean,
|
|
631
|
+
default_value: true
|
|
632
|
+
),
|
|
633
|
+
|
|
614
634
|
]
|
|
615
635
|
end
|
|
616
636
|
|
|
@@ -12,25 +12,27 @@ module Fastlane
|
|
|
12
12
|
UI.message("Hello from the buildstash plugin helper!")
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def self.post_json(url:, body:, headers:)
|
|
15
|
+
def self.post_json(url:, body:, headers:, ssl_verify: true)
|
|
16
16
|
uri = URI(url)
|
|
17
17
|
http = Net::HTTP.new(uri.host, uri.port)
|
|
18
18
|
http.use_ssl = (uri.scheme == "https")
|
|
19
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE unless ssl_verify
|
|
19
20
|
request = Net::HTTP::Post.new(uri.path, headers)
|
|
20
21
|
request.body = body.to_json
|
|
21
22
|
http.request(request)
|
|
22
23
|
end
|
|
23
24
|
|
|
24
|
-
def self.upload_file(url:, file_path:, headers:)
|
|
25
|
+
def self.upload_file(url:, file_path:, headers:, ssl_verify: true)
|
|
25
26
|
uri = URI(url)
|
|
26
27
|
http = Net::HTTP.new(uri.host, uri.port)
|
|
27
28
|
http.use_ssl = (uri.scheme == "https")
|
|
29
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE unless ssl_verify
|
|
28
30
|
request = Net::HTTP::Put.new(uri.request_uri, headers)
|
|
29
31
|
request.body = File.binread(file_path)
|
|
30
32
|
http.request(request)
|
|
31
33
|
end
|
|
32
34
|
|
|
33
|
-
def self.upload_chunked_file(file_path:, filesize:, pending_upload_id:, chunk_count:, chunk_size_mb:, api_key:, is_expansion: false)
|
|
35
|
+
def self.upload_chunked_file(file_path:, filesize:, pending_upload_id:, chunk_count:, chunk_size_mb:, api_key:, is_expansion: false, ssl_verify: true)
|
|
34
36
|
parts = []
|
|
35
37
|
chunk_size = chunk_size_mb * 1024 * 1024
|
|
36
38
|
endpoint = is_expansion ?
|
|
@@ -50,6 +52,7 @@ module Fastlane
|
|
|
50
52
|
uri = URI(endpoint)
|
|
51
53
|
http = Net::HTTP.new(uri.host, uri.port)
|
|
52
54
|
http.use_ssl = true
|
|
55
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE unless ssl_verify
|
|
53
56
|
req = Net::HTTP::Post.new(uri.path, {
|
|
54
57
|
"Authorization" => "Bearer #{api_key}",
|
|
55
58
|
"Content-Type" => "application/json",
|
|
@@ -77,6 +80,7 @@ module Fastlane
|
|
|
77
80
|
uri = URI(presigned_url)
|
|
78
81
|
http = Net::HTTP.new(uri.host, uri.port)
|
|
79
82
|
http.use_ssl = true
|
|
83
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE unless ssl_verify
|
|
80
84
|
|
|
81
85
|
upload = Net::HTTP::Put.new(uri.request_uri, {
|
|
82
86
|
"Content-Type" => "application/octet-stream",
|