escobar 0.3.14 → 0.3.16
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/escobar/heroku/build_request.rb +9 -3
- data/lib/escobar/heroku/dynos.rb +6 -2
- data/lib/escobar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a382144e7cf43964b7d536c12bae3f213e9f095a
|
4
|
+
data.tar.gz: f8f94fbdfb0520e0e9747d5e63f2385eb6634548
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cea58f14afa944e6cf7076e5fc0b6a9c506075e51ea1d196795de56cf27caf06728d0e995848d67b430ee66e25767f09994b68d793b8f44fa693a38590c17fdd
|
7
|
+
data.tar.gz: c14f2a2fd3b6b86a95ab9d940fe3114ad47dfc9b9482057f131c229261321465f65cc0d5aafc052a3434f7aedb36abfbd8a5dd73dd54843b897f83bfe859e649
|
@@ -17,6 +17,9 @@ module Escobar
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
+
class RequiresTwoFactorError < Error
|
21
|
+
end
|
22
|
+
|
20
23
|
attr_reader :app_id, :github_deployment_url, :pipeline, :sha
|
21
24
|
|
22
25
|
attr_accessor :environment, :ref, :forced, :custom_payload
|
@@ -39,9 +42,7 @@ module Escobar
|
|
39
42
|
end
|
40
43
|
|
41
44
|
def create(task, environment, ref, forced, custom_payload)
|
42
|
-
if app.locked?
|
43
|
-
raise error_for("Application requires second factor: #{app.name}")
|
44
|
-
end
|
45
|
+
raise_2fa_error if app.locked?
|
45
46
|
|
46
47
|
@environment = environment
|
47
48
|
@ref = ref
|
@@ -51,6 +52,11 @@ module Escobar
|
|
51
52
|
create_in_api(task)
|
52
53
|
end
|
53
54
|
|
55
|
+
def raise_2fa_error
|
56
|
+
message = "Application requires second factor: #{app.name}"
|
57
|
+
raise RequiresTwoFactorError.new_from_build_request(self, message)
|
58
|
+
end
|
59
|
+
|
54
60
|
def create_in_api(task)
|
55
61
|
create_github_deployment(task)
|
56
62
|
|
data/lib/escobar/heroku/dynos.rb
CHANGED
@@ -17,14 +17,18 @@ module Escobar
|
|
17
17
|
@info ||= client.heroku.get("/apps/#{app_id}/dynos")
|
18
18
|
end
|
19
19
|
|
20
|
+
def non_one_off
|
21
|
+
info.reject { |dyno| dyno["type"] == "run" }
|
22
|
+
end
|
23
|
+
|
20
24
|
def running?(release_id)
|
21
|
-
|
25
|
+
non_one_off.all? do |dyno|
|
22
26
|
dyno["release"]["id"] == release_id && dyno["state"] == "up"
|
23
27
|
end
|
24
28
|
end
|
25
29
|
|
26
30
|
def newer_than?(epoch)
|
27
|
-
|
31
|
+
non_one_off.all? do |dyno|
|
28
32
|
epoch < Time.parse(dyno["created_at"]).utc
|
29
33
|
end
|
30
34
|
end
|
data/lib/escobar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: escobar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Donohoe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|