heroku_deployer 0.4 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/amitree/heroku_client.rb +14 -2
- 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: 90cdcee100cee48c3a5a712688c9b3255bf31242
|
4
|
+
data.tar.gz: f9894580ed175898940aabce30dd1684bfa3dd95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32f73dad2edc8cd404c53adb1e9a3b05daf6b5e852cdc0ccb8cd8b134555dbe1804cd7d08545cae0ec685769750b67cfb92a3ffafc1b928f4f19fe04ccdce190
|
7
|
+
data.tar.gz: 07af7d6e65f1bfa68e055dfd358259faad0cdcb76c9c14c824dfd692139971a26b954b8e126925544c8fd8e689d7ceb32d76a9fada0c37c1e1bd2e9c59c7d449
|
@@ -7,6 +7,9 @@ module Amitree
|
|
7
7
|
class Error < StandardError
|
8
8
|
end
|
9
9
|
|
10
|
+
class PostDeploymentError < Error
|
11
|
+
end
|
12
|
+
|
10
13
|
def initialize(api_key, staging_app_name, production_app_name)
|
11
14
|
@heroku = Heroku::API.new(:api_key => api_key)
|
12
15
|
# We need to use the new API (not currently supported by the heroku-api gem) for deploy_to_production
|
@@ -61,8 +64,17 @@ module Amitree
|
|
61
64
|
result.body['slug']['id'] || raise(Error.new("Could not find slug in API response: #{result.inspect}"))
|
62
65
|
end
|
63
66
|
|
64
|
-
def db_migrate_on_production
|
65
|
-
|
67
|
+
def db_migrate_on_production(attempts=0)
|
68
|
+
begin
|
69
|
+
heroku_run @production_app_name, 'rake db:migrate db:seed'
|
70
|
+
rescue => e
|
71
|
+
if attempts < 2
|
72
|
+
db_migrate_on_production(attempts+1)
|
73
|
+
raise PostDeploymentError if attempts == 0
|
74
|
+
else
|
75
|
+
raise e
|
76
|
+
end
|
77
|
+
end
|
66
78
|
end
|
67
79
|
|
68
80
|
private
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroku_deployer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Wargnier
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|