dpl-heroku 1.10.5.travis.3069.5 → 1.10.5.travis.3089.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 +4 -4
- data/lib/dpl/provider/heroku/api.rb +7 -5
- data/spec/provider/heroku_spec.rb +16 -42
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eefc9cbfca4c0079f6acbb12553ef16ab89027dcb72355a9c165efd569709cde
|
4
|
+
data.tar.gz: 2005407442e84139948b520deb36898d068d42b8b3322e7408e6432086e9dd40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2fdb8f343b1537cfb6b2be4f184ad026c7ff717d9c70b4080106e6b13d8d9cfa9f61151479911c5edb9f1e45b02545342a4b8a6f1c47cd50383992fd481c65a
|
7
|
+
data.tar.gz: dcdc6a43dc82eec638c7db3700f328d9d4c38a60b39fc756132bc9c5edaac87d589d522d09c77bbb2b14b0201019e42406911842bcb77229993074e371a577af
|
@@ -52,16 +52,18 @@ module DPL
|
|
52
52
|
|
53
53
|
def verify_build
|
54
54
|
loop do
|
55
|
-
response = faraday.get("/apps/#{option(:app)}/builds/#{build_id}
|
56
|
-
|
57
|
-
|
55
|
+
response = faraday.get("/apps/#{option(:app)}/builds/#{build_id}")
|
56
|
+
body = JSON.parse(response.body)
|
57
|
+
|
58
|
+
case body['status']
|
59
|
+
when 'pending'
|
58
60
|
log "heroku build still pending"
|
59
61
|
sleep 5
|
60
62
|
next
|
61
|
-
|
63
|
+
when 'succeeded'
|
62
64
|
break
|
63
65
|
else
|
64
|
-
error "deploy failed
|
66
|
+
error "deploy failed"
|
65
67
|
end
|
66
68
|
end
|
67
69
|
end
|
@@ -11,7 +11,7 @@ RSpec.shared_context 'with faraday' do
|
|
11
11
|
stub.get("/account") {|env| [200, response_headers, account_response_body]}
|
12
12
|
stub.get("/apps/example") {|env| [200, response_headers, app_response_body]}
|
13
13
|
stub.post("/apps/example/builds") {|env| [201, response_headers, builds_response_body]}
|
14
|
-
stub.get("/apps/example/builds/01234567-89ab-cdef-0123-456789abcdef
|
14
|
+
stub.get("/apps/example/builds/01234567-89ab-cdef-0123-456789abcdef") {|env| [200, response_headers, build_response_body]}
|
15
15
|
stub.post("/sources") {|env| [201, response_headers, source_response_body] }
|
16
16
|
stub.post("/apps/example/dynos") {|env| [201, response_headers, dynos_create_response_body]}
|
17
17
|
stub.delete("/apps/example/dynos") {|env| [202, response_headers, '{}'] }
|
@@ -163,53 +163,27 @@ RSpec.shared_context 'with faraday' do
|
|
163
163
|
}'
|
164
164
|
}
|
165
165
|
|
166
|
-
let(:
|
166
|
+
let(:build_response_body) {
|
167
167
|
'{
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
"output_stream_url": "https://build-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef"
|
172
|
-
},
|
173
|
-
"exit_code": 0,
|
174
|
-
"lines": [
|
175
|
-
{
|
176
|
-
"line": "-----> Ruby app detected\n",
|
177
|
-
"stream": "STDOUT"
|
178
|
-
}
|
179
|
-
]
|
168
|
+
"id": "01234567-89ab-cdef-0123-456789abcdef",
|
169
|
+
"status": "succeeded",
|
170
|
+
"output_stream_url": "https://build-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef"
|
180
171
|
}'
|
181
172
|
}
|
182
173
|
|
183
|
-
let(:
|
174
|
+
let(:build_response_body_failure) {
|
184
175
|
'{
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
"output_stream_url": "https://build-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef"
|
189
|
-
},
|
190
|
-
"exit_code": 1,
|
191
|
-
"lines": [
|
192
|
-
{
|
193
|
-
"line": "-----> Ruby app detected\n",
|
194
|
-
"stream": "STDOUT"
|
195
|
-
}
|
196
|
-
]
|
176
|
+
"id": "01234567-89ab-cdef-0123-456789abcdef",
|
177
|
+
"status": "failed",
|
178
|
+
"output_stream_url": "https://build-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef"
|
197
179
|
}'
|
198
180
|
}
|
199
181
|
|
200
|
-
let(:
|
182
|
+
let(:build_response_body_in_progress) {
|
201
183
|
'{
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
"output_stream_url": "https://build-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef"
|
206
|
-
},
|
207
|
-
"lines": [
|
208
|
-
{
|
209
|
-
"line": "-----> Ruby app detected\n",
|
210
|
-
"stream": "STDOUT"
|
211
|
-
}
|
212
|
-
]
|
184
|
+
"id": "01234567-89ab-cdef-0123-456789abcdef",
|
185
|
+
"status": "pending",
|
186
|
+
"output_stream_url": "https://build-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef"
|
213
187
|
}'
|
214
188
|
}
|
215
189
|
end
|
@@ -298,8 +272,8 @@ describe DPL::Provider::Heroku, :api do
|
|
298
272
|
example do
|
299
273
|
expect(provider).to receive(:faraday).at_least(:once).and_return(faraday)
|
300
274
|
expect(provider).to receive(:build_id).at_least(:once).and_return('01234567-89ab-cdef-0123-456789abcdef')
|
301
|
-
stubs.get("/apps/example/builds/01234567-89ab-cdef-0123-456789abcdef
|
302
|
-
expect{ provider.verify_build }.to raise_error("deploy failed
|
275
|
+
stubs.get("/apps/example/builds/01234567-89ab-cdef-0123-456789abcdef") {|env| [200, response_headers, build_response_body_failure]}
|
276
|
+
expect{ provider.verify_build }.to raise_error("deploy failed")
|
303
277
|
end
|
304
278
|
end
|
305
279
|
|
@@ -307,7 +281,7 @@ describe DPL::Provider::Heroku, :api do
|
|
307
281
|
example do
|
308
282
|
expect(provider).to receive(:faraday).at_least(:once).and_return(faraday)
|
309
283
|
expect(provider).to receive(:build_id).at_least(:once).and_return('01234567-89ab-cdef-0123-456789abcdef')
|
310
|
-
stubs.get("/apps/example/builds/01234567-89ab-cdef-0123-456789abcdef
|
284
|
+
stubs.get("/apps/example/builds/01234567-89ab-cdef-0123-456789abcdef") {|env| [200, response_headers, build_response_body_in_progress]}
|
311
285
|
expect(provider).to receive(:sleep).with(5).and_return(true)
|
312
286
|
expect{ provider.verify_build }.not_to raise_error
|
313
287
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dpl-heroku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.5.travis.
|
4
|
+
version: 1.10.5.travis.3089.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Haase
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dpl
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.10.5.travis.
|
19
|
+
version: 1.10.5.travis.3089.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.10.5.travis.
|
26
|
+
version: 1.10.5.travis.3089.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: faraday
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|