fastlane-plugin-zealot 0.2.0 → 0.2.1

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: 34621d7f1d471105ef4f2ce9466f5224833b36b1eecd75153d3964e3a1b7d18b
4
- data.tar.gz: b04284be27139362c64f4dd17f4a2ecea13a90c85c6190375c7f1d2e75052ee4
3
+ metadata.gz: 541008be46db0acc6f63c11507667346ac813719997907cccc28433482138c5a
4
+ data.tar.gz: c159607cffbcd36b3517a826882d2ec796ae4fa37ca13bdc6dff3020ca14745e
5
5
  SHA512:
6
- metadata.gz: b55bb732cc1f27afee3b1502140f42fa55f0e8e2654eab7352e7db1520557b40680a89f23002f9576582bb642b096081289914ced6ebb464d773b8d85a23cd84
7
- data.tar.gz: ed766de38a64b69fc0c970fe1e072489f6e1aa72ee834a51c237f175c79689af41727d6b9f6759d76a207a9f4de0c692a0800c167de63f251a2f27eb5776cc3e
6
+ metadata.gz: 85e3a03b613454106d1d84641f2126f3e5897cd7d66e09c6d2c1313f4be78516879afef487a7c365a05474208501bc95521d3fb47a2da68b8c970793b5bba8e6
7
+ data.tar.gz: f67e5654ef4ec360ded363fcde904e8aa93d10b212246a25952b3df536b048a3e18122f1b752776d09717aedc2a4c4c12522003def5cdfbf543a42b2ce00ebc8
@@ -6,9 +6,12 @@ require_relative '../helper/zealot_helper'
6
6
  module Fastlane
7
7
  module Actions
8
8
  module SharedValues
9
+ ZEALOT_APP_ID = :ZEALOT_APP_ID
10
+ ZEALOT_RELEASE_ID = :ZEALOT_RELEASE_ID
9
11
  ZEALOT_RELEASE_URL = :ZEALOT_RELEASE_URL
10
12
  ZEALOT_QRCODE_URL = :ZEALOT_QRCODE_URL
11
13
  ZEALOT_INSTALL_URL = :ZEALOT_INSTALL_URL
14
+ ZEAALOT_ERROR_MESSAGE = :ZEAALOT_ERROR_MESSAGE
12
15
  end
13
16
 
14
17
  class ZealotAction < Action
@@ -32,10 +35,16 @@ module Fastlane
32
35
 
33
36
  UI.verbose response.body.to_s
34
37
 
38
+ if response.status != 201
39
+ return show_error("Error uploading to Zealot [#{response.status}]: #{response.body}", fail_on_error)
40
+ end
41
+
35
42
  if (body = response.body) && (error = body['error'])
36
43
  return show_error("Error uploading to Zealot: #{response.body}", fail_on_error)
37
44
  end
38
45
 
46
+ Actions.lane_context[SharedValues::ZEALOT_APP_ID] = body['app']['id']
47
+ Actions.lane_context[SharedValues::ZEALOT_RELEASE_ID] = body['id']
39
48
  Actions.lane_context[SharedValues::ZEALOT_RELEASE_URL] = body['release_url']
40
49
  Actions.lane_context[SharedValues::ZEALOT_INSTALL_URL] = body['install_url']
41
50
  Actions.lane_context[SharedValues::ZEALOT_QRCODE_URL] = body['qrcode_url']
@@ -177,11 +186,12 @@ module Fastlane
177
186
 
178
187
  def self.output
179
188
  [
180
- [
181
- 'ZEALOT_RELEASE_URL', 'The release URL of the newly uploaded build',
182
- 'ZEALOT_INSTALL_URL', 'The install URL of the newly uploaded build',
183
- 'ZEALOT_QRCODE_URL', 'The QRCode URL of the newly uploaded build'
184
- ]
189
+ ['ZEALOT_APP_ID', 'The id of app'],
190
+ ['ZEALOT_RELEASE_ID', 'The id of app\'s release'],
191
+ ['ZEALOT_RELEASE_URL', 'The release URL of the newly uploaded build'],
192
+ ['ZEALOT_INSTALL_URL', 'The install URL of the newly uploaded build'],
193
+ ['ZEALOT_QRCODE_URL', 'The QRCode URL of the newly uploaded build'],
194
+ ['ZEAALOT_ERROR_MESSAGE', 'The error message during upload process'],
185
195
  ]
186
196
  end
187
197
 
@@ -186,11 +186,7 @@ module Fastlane
186
186
 
187
187
  def self.output
188
188
  [
189
- [
190
- 'ZEALOT_RELEASE_URL', 'The release URL of the newly uploaded build',
191
- 'ZEALOT_INSTALL_URL', 'The install URL of the newly uploaded build',
192
- 'ZEALOT_QRCODE_URL', 'The QRCode URL of the newly uploaded build'
193
- ]
189
+ ['ZEAALOT_ERROR_MESSAGE', 'The error message during upload process']
194
190
  ]
195
191
  end
196
192
 
@@ -6,7 +6,7 @@ require_relative '../helper/zealot_helper'
6
6
  module Fastlane
7
7
  module Actions
8
8
  module SharedValues
9
- ZEALOT_APP_VERSION_EXISTED = :ZEALOT_APP_VERSION_EXISTED
9
+ ZEALOT_VERSION_EXISTED = :ZEALOT_VERSION_EXISTED
10
10
  end
11
11
 
12
12
  class ZealotVersionCheckAction < Action
@@ -28,7 +28,7 @@ module Fastlane
28
28
 
29
29
  return show_error(response.body['error'], fail_on_error) if is_existed.nil?
30
30
 
31
- Actions.lane_context[SharedValues::ZEALOT_APP_VERSION_EXISTED] = is_existed
31
+ Actions.lane_context[SharedValues::ZEALOT_VERSION_EXISTED] = is_existed
32
32
 
33
33
  if is_existed
34
34
  UI.important 'Found app version, you can skip upload it'
@@ -123,9 +123,8 @@ module Fastlane
123
123
 
124
124
  def self.output
125
125
  [
126
- [
127
- 'ZEALOT_APP_VERSION_EXISTED', 'The result of app verison existed (Boolean)'
128
- ]
126
+ ['ZEALOT_VERSION_EXISTED', 'The result of app verison existed (Boolean)'],
127
+ ['ZEAALOT_ERROR_MESSAGE', 'The error message during upload process']
129
128
  ]
130
129
  end
131
130
 
@@ -20,6 +20,8 @@ module Fastlane
20
20
  req.options.timeout = params[:timeout]
21
21
  req.body = form
22
22
  end
23
+ rescue Faraday::ConnectionFailed
24
+ show_error('Can not connecting to Zealot', params[:fail_on_error])
23
25
  rescue Faraday::Error::TimeoutError
24
26
  show_error('Uploading build to Zealot timed out ⏳', params[:fail_on_error])
25
27
  end
@@ -52,6 +54,8 @@ module Fastlane
52
54
  req.options.timeout = params[:timeout]
53
55
  req.body = form
54
56
  end
57
+ rescue Faraday::ConnectionFailed
58
+ show_error('Can not connecting to Zealot', params[:fail_on_error])
55
59
  rescue Faraday::Error::TimeoutError
56
60
  show_error('Uploading build to Apphost timed out ⏳', params[:fail_on_error])
57
61
  end
@@ -91,6 +95,8 @@ module Fastlane
91
95
  req.url '/api/apps/version_exist'
92
96
  req.params = query
93
97
  end
98
+ rescue Faraday::ConnectionFailed
99
+ show_error('Can not connecting to Zealot', params[:fail_on_error])
94
100
  rescue Faraday::Error::TimeoutError
95
101
  show_error('Check app version from Zealot timed out ⏳', params[:fail_on_error])
96
102
  end
@@ -155,7 +161,9 @@ module Fastlane
155
161
  )
156
162
  end
157
163
 
158
- def show_error(message, fail_on_error)
164
+ def show_error(message, fail_on_error, store_shared_value = true)
165
+ Actions.lane_context[SharedValues::ZEAALOT_ERROR_MESSAGE] = message if store_shared_value
166
+
159
167
  if fail_on_error
160
168
  UI.user_error!(message)
161
169
  else
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Zealot
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-zealot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - icyleaf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-28 00:00:00.000000000 Z
11
+ date: 2020-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane-plugin-debug_file