escobar 0.3.2 → 0.3.3

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
  SHA1:
3
- metadata.gz: 43c11ea0237775c7cc976d2e875e1c65d7529e38
4
- data.tar.gz: 84133f99aa2ec696eeb4a1c407972894b721f2a1
3
+ metadata.gz: ff75fb2f007ee2572fc7ddb28dfe605b6cdea6da
4
+ data.tar.gz: b5a26ee3982f61ca17da2d7f7d0ed79563af0329
5
5
  SHA512:
6
- metadata.gz: 3186ae4bc9555ff17682e04442b02a93d514f557d22b5e41a1880a935aec31812232cafadf0277b51123811439024ac3cb91beac10feb31373ec5221f415cc0e
7
- data.tar.gz: 3db647aee08e12fcb1a48b5ffc8f28d0b64fcde32b99b270245dbe1160b76168fbcb2298f917efce219a9b187d69f95d906f83fd4c5538ffec49ae043ead371e
6
+ metadata.gz: 4b397ad8902df738d4eaef2708f33347bdbaacfdacc5c2d722f84ad8dcb55220c7883b03993f53c40466f3dfeaef0effdde90182f2c5139bc21025947756d610
7
+ data.tar.gz: 7bae6a4857e338f692557d12bbe42ae8777947ad76bccfad4688b37b09f4c654c3a66140f5a911325b2a9df5e22792a915a57e4d65e7fc459aa6ed2587ffc98e
@@ -30,6 +30,10 @@ module Escobar
30
30
  Error.new_from_build_request(self, message)
31
31
  end
32
32
 
33
+ def cache_key
34
+ "escobar-build-request-#{app.name}"
35
+ end
36
+
33
37
  def create(task, environment, ref, forced, custom_payload)
34
38
  if app.locked?
35
39
  raise error_for("Application requires second factor: #{app.name}")
@@ -91,23 +91,24 @@ module Escobar
91
91
  end
92
92
  end
93
93
 
94
- # rubocop:disable Metrics/LineLength
95
- def create_deployment(ref, environment, force = false, custom_payload = {})
94
+ def default_heroku_application(environment)
96
95
  app = environments[environment] && environments[environment].last
97
96
  unless app
98
97
  raise ArgumentError, "No '#{environment}' environment for #{name}."
99
98
  end
99
+ app.app
100
+ end
100
101
 
101
- heroku_app = app.app
102
+ def create_deployment(ref, environment, force = false, payload = {})
103
+ heroku_app = default_heroku_application(environment)
102
104
 
103
105
  build_request = heroku_app.build_request_for(self)
104
106
  heroku_build = build_request.create(
105
- "deploy", environment, ref, force, custom_payload
107
+ "deploy", environment, ref, force, payload
106
108
  )
107
109
 
108
110
  heroku_build
109
111
  end
110
- # rubocop:enable Metrics/LineLength
111
112
 
112
113
  def get(path)
113
114
  response = kolkrabbi_client.get do |request|
@@ -146,17 +147,6 @@ module Escobar
146
147
  create_deployment_status(url, payload)
147
148
  end
148
149
 
149
- def create_heroku_build(app_name, sha)
150
- body = {
151
- source_blob: {
152
- url: github_client.archive_link(sha),
153
- version: sha[0..7],
154
- version_description: "#{github_repository}:#{sha}"
155
- }
156
- }
157
- client.heroku.post("/apps/#{app_name}/builds", body)
158
- end
159
-
160
150
  def github_client
161
151
  @github_client ||= Escobar::GitHub::Client.new(client.github_token,
162
152
  github_repository)
@@ -1,3 +1,3 @@
1
1
  module Escobar
2
- VERSION = "0.3.2".freeze
2
+ VERSION = "0.3.3".freeze
3
3
  end
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.2
4
+ version: 0.3.3
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-01-11 00:00:00.000000000 Z
11
+ date: 2017-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday