fastlane-plugin-execute_api 0.1.0 → 0.1.3
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: 005eddd0a22a8642024c5f64f313fe26a92348103914fee7d4168e4e460505d2
|
4
|
+
data.tar.gz: 21546ba9d34497d18339b51c2e935900ca624c84290e8362f0ae9a81c8177e2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 279622720e434c79392ceae1fd96c704695e2d09b77ba49ccbe7c99c36824f721b2b0a9cb2588fb4445aca594e4725fa302379fb992f8ae82615776bf6ca2d4f
|
7
|
+
data.tar.gz: ccd2fcd6aaf1f16f42e2c764fb1e5b62c7f69031878148bedc904b2ff0ac6ec79ca8f55f413b8020a605551d54e6993bd91cf50e2c50ce8feb2e4f746a89336e
|
@@ -8,7 +8,6 @@ module Fastlane
|
|
8
8
|
def self.run(config)
|
9
9
|
params = {}
|
10
10
|
# extract parms from config received from fastlane
|
11
|
-
params[:uploadArtifacts] = config[:uploadArtifacts]
|
12
11
|
params[:endPoint] = config[:endPoint]
|
13
12
|
params[:apk] = config[:apk]
|
14
13
|
params[:ipa] = config[:ipa]
|
@@ -18,14 +17,17 @@ module Fastlane
|
|
18
17
|
params[:multipartPayload] = config[:multipartPayload]
|
19
18
|
params[:headers] = config[:headers]
|
20
19
|
|
21
|
-
upload_artifacts = params[:uploadArtifacts]
|
22
20
|
apk_file = params[:apk]
|
23
21
|
ipa_file = params[:ipa]
|
24
22
|
custom_file = params[:file]
|
25
|
-
|
23
|
+
|
26
24
|
end_point = params[:endPoint]
|
27
25
|
|
28
|
-
|
26
|
+
upload_artifacts = ipa_file.to_s.length > 0 || apk_file.to_s.length > 0 || custom_file.to_s.length > 0
|
27
|
+
|
28
|
+
params[:uploadArtifacts] = upload_artifacts.to_s
|
29
|
+
|
30
|
+
UI.user_error!("No endPoint given, pass using endPoint: 'endpoint'") if end_point.to_s.length == 0
|
29
31
|
UI.user_error!("No IPA or APK or a file path given, pass using `ipa: 'ipa path'` or `apk: 'apk path' or file:`") if upload_artifacts && ipa_file.to_s.length == 0 && apk_file.to_s.length == 0 && custom_file.to_s.length == 0
|
30
32
|
UI.user_error!("Please only give IPA path or APK path (not both)") if upload_artifacts && ipa_file.to_s.length > 0 && apk_file.to_s.length > 0
|
31
33
|
|
@@ -45,13 +47,13 @@ module Fastlane
|
|
45
47
|
multipart_payload[:multipart] = true
|
46
48
|
if multipart_payload[:fileFormFieldName]
|
47
49
|
key = multipart_payload[:fileFormFieldName]
|
48
|
-
multipart_payload[
|
50
|
+
multipart_payload[key.to_s] = File.new(custom_file, 'rb')
|
49
51
|
else
|
50
52
|
multipart_payload[:file] = File.new(custom_file, 'rb')
|
51
53
|
end
|
52
54
|
|
53
|
-
|
54
|
-
|
55
|
+
UI.message(multipart_payload)
|
56
|
+
upload_request(params, multipart_payload)
|
55
57
|
end
|
56
58
|
|
57
59
|
def self.upload_request(params, multipart_payload)
|
@@ -60,15 +62,13 @@ module Fastlane
|
|
60
62
|
url: params[:endPoint],
|
61
63
|
payload: multipart_payload,
|
62
64
|
headers: params[:headers],
|
63
|
-
log: Logger.new(
|
65
|
+
log: Logger.new($stdout)
|
64
66
|
)
|
65
67
|
|
66
68
|
response = request.execute
|
67
69
|
UI.message(response)
|
68
|
-
if
|
69
|
-
UI.success("Successfully finished uploading the fille")
|
70
|
-
else
|
71
|
-
UI.success("Successfully finished executing the request") if response.code == 200 || response.code == 201
|
70
|
+
if response.code == 200 || response.code == 201
|
71
|
+
params[:uploadArtifacts]? UI.success("Successfully finished uploading the fille") : UI.success("Successfully finished executing the request")
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
@@ -95,8 +95,7 @@ module Fastlane
|
|
95
95
|
env_name: "",
|
96
96
|
description: "uploading any file or not",
|
97
97
|
optional: true,
|
98
|
-
default_value: false,
|
99
|
-
type: Boolean),
|
98
|
+
default_value: false),
|
100
99
|
FastlaneCore::ConfigItem.new(key: :apk,
|
101
100
|
env_name: "",
|
102
101
|
description: ".apk file for the build",
|