escobar 0.1.9 → 0.1.10

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
  SHA1:
3
- metadata.gz: 01ad21160912979d47383fb8fb83da53afcae7ff
4
- data.tar.gz: 290aaa0bf2c42725dc8367592a0674995f130348
3
+ metadata.gz: b458f216437aed93fc45c6e917be74521724a199
4
+ data.tar.gz: f5da689ed96df3321e5951d3a21ba6aaa208e165
5
5
  SHA512:
6
- metadata.gz: 94f334a512cea6d0a66edbb92736c76f2f731aba2506fc3d537c12c7efaf34823a795f4b3cdb1e4627a2032eae00480a56e8b3163fa1f654b15748f06c7f9003
7
- data.tar.gz: f4cb80571cb30c5f9be60e4cfa6e62e8a79cd0b010e83e76c3d14cc320eeaed3296020e0f931bf3dab23acc79edd67eab8d6996ee3a379d6bf8aaf7064639a98
6
+ metadata.gz: d84e7dcd1c87ec8b196f7f879b955cea73ecf09e0539c07cf9651cb68eed60b755f332c2b23338a641b682cd277bee11b89263820c81bce67353f528a2a7e4a1
7
+ data.tar.gz: 39ada2950b69befb7105d443f0a2a9c23dfa0b1f4c3e98741a2a95549302981df456c1122d3361afc01222d38bf0e6eb946088eee0a7750921c8983dc782524d
@@ -30,8 +30,6 @@ module Escobar
30
30
  case info["status"]
31
31
  when "succeeded", "failed"
32
32
  info
33
- else
34
- nil
35
33
  end
36
34
  end
37
35
  end
@@ -66,31 +66,34 @@ module Escobar
66
66
 
67
67
  archive_link = deployment.archive_link
68
68
 
69
- payload = self.to_hash
70
- payload[:name] = name
71
- payload[:provider] = "slash-heroku"
72
-
73
- github_deployment = deployment.create(payload)
74
- body = {
75
- source_blob: {
76
- url: archive_link,
77
- version: github_deployment.sha[0..7],
78
- version_description: "#{deployment.repo}:#{github_deployment.sha}"
79
- }
80
- }
81
- app = environments[environment].last
82
- build = client.heroku.post("/apps/#{app.name}/builds", body)
83
- if build["id"]
84
- status_payload = {
85
- target_url: "#{app.app.dashboard_url}/activity/builds/#{build['id']}",
86
- description: "Deploying from slash-heroku"
69
+ app = environments[environment] && environments[environment].last
70
+ if app
71
+ payload = self.to_hash
72
+ payload[:name] = name
73
+ payload[:provider] = "slash-heroku"
74
+
75
+ github_deployment = deployment.create(payload)
76
+ body = {
77
+ source_blob: {
78
+ url: archive_link,
79
+ version: github_deployment.sha[0..7],
80
+ version_description: "#{deployment.repo}:#{github_deployment.sha}"
81
+ }
87
82
  }
88
83
 
89
- deployment.create_status(github_deployment.url, "pending", status_payload)
90
- {
91
- app_id: app.name, build_id: build["id"],
92
- deployment_url: github_deployment.url
93
- }
84
+ build = client.heroku.post("/apps/#{app.name}/builds", body)
85
+ if build["id"]
86
+ status_payload = {
87
+ target_url: "#{app.app.dashboard_url}/activity/builds/#{build['id']}",
88
+ description: "Deploying from slash-heroku"
89
+ }
90
+
91
+ deployment.create_status(github_deployment.url, "pending", status_payload)
92
+ {
93
+ app_id: app.name, build_id: build["id"],
94
+ deployment_url: github_deployment.url
95
+ }
96
+ end
94
97
  end
95
98
  end
96
99
 
@@ -1,3 +1,3 @@
1
1
  module Escobar
2
- VERSION = "0.1.9".freeze
2
+ VERSION = "0.1.10".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: escobar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Donohoe