heroku_deploy 0.1.4 → 0.1.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.
data/README.markdown CHANGED
@@ -47,6 +47,9 @@ or
47
47
 
48
48
  rake heroku_deploy:backup:production
49
49
 
50
+ To skip the backup when deploying to staging or production run:
51
+
52
+ rake heroku_deploy:staging backup=false
53
+
50
54
  ###Coming Soon
51
55
  * Before and after hooks that allow you to arbitrarily execute code before and after deploy
52
- * a --nobackup option that skips the backup when deploying to production or staging
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{heroku_deploy}
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ross Hale", "Chris Lemcke"]
@@ -98,7 +98,7 @@ class HerokuDeploy
98
98
  end
99
99
 
100
100
  def staging
101
- backup staging_app
101
+ backup staging_app unless no_backup
102
102
 
103
103
  puts "Deploying to Staging"
104
104
  merge "master", "staging"
@@ -110,7 +110,7 @@ class HerokuDeploy
110
110
  end
111
111
 
112
112
  def production
113
- backup production_app
113
+ backup production_app unless no_backup
114
114
 
115
115
  puts "Deploying to Production"
116
116
  merge "staging", "production"
@@ -149,7 +149,7 @@ class HerokuDeploy
149
149
 
150
150
  `heroku maintenance:on --app #{app}`
151
151
 
152
- puts "Waiting for slug to re-compile..."
152
+ print "Waiting for slug to re-compile..."
153
153
  wait_for_maintenance_page( app )
154
154
  puts ""
155
155
 
@@ -172,7 +172,6 @@ class HerokuDeploy
172
172
 
173
173
  end
174
174
 
175
-
176
175
  def backup( app )
177
176
  puts ""
178
177
  puts "Beginning Backup"
@@ -222,6 +221,8 @@ class HerokuDeploy
222
221
  `heroku bundles --app #{app}`.include?(" complete ")
223
222
  end
224
223
 
225
-
224
+ def no_backup
225
+ ENV['BACKUP'] == "false" || ENV['backup'] == "false"
226
+ end
226
227
 
227
228
  end
@@ -40,14 +40,6 @@ class HerokuDeployTest < Test::Unit::TestCase
40
40
  @heroku_deploy.setup
41
41
  end
42
42
 
43
- should "invoke staging" do
44
- @heroku_deploy.staging
45
- end
46
-
47
- should "invoke production" do
48
- @heroku_deploy.production
49
- end
50
-
51
43
  should "invoke backup_staging" do
52
44
  @heroku_deploy.backup_staging
53
45
  end
@@ -56,6 +48,34 @@ class HerokuDeployTest < Test::Unit::TestCase
56
48
  @heroku_deploy.backup_production
57
49
  end
58
50
 
51
+ context "with backup" do
52
+
53
+ should "invoke staging and backup" do
54
+ mock.proxy(@heroku_deploy).backup("example-staging")
55
+ @heroku_deploy.staging
56
+ end
57
+
58
+ should "invoke production and backup" do
59
+ mock.proxy(@heroku_deploy).backup("example")
60
+ @heroku_deploy.production
61
+ end
62
+ end
63
+
64
+ context "without backup" do
65
+
66
+ should "invoke staging and skip backup" do
67
+ ENV['BACKUP'] = "false"
68
+ dont_allow(@heroku_deploy).backup("example-staging")
69
+ @heroku_deploy.staging
70
+ end
71
+
72
+ should "invoke production and skip backup" do
73
+ ENV['backup'] = "false"
74
+ dont_allow(@heroku_deploy).backup("example")
75
+ @heroku_deploy.production
76
+ end
77
+ end
78
+
59
79
  end
60
80
 
61
81
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku_deploy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
9
+ - 5
10
+ version: 0.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ross Hale