heroku_san 4.0.7 → 4.0.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change log (curated)
2
2
 
3
+ ## v4.0.8
4
+
5
+ * Closes #113 & #117
6
+
3
7
  ## v4.0.7
4
8
 
5
9
  * Closes #114 & #111
data/README.md CHANGED
@@ -48,10 +48,14 @@ Update your `Rakefile`:
48
48
 
49
49
  ```ruby
50
50
  require "bundler/setup"
51
- require "heroku_san"
52
- config_file = File.join(File.expand_path(File.dirname(__FILE__)), 'config', 'heroku.yml')
53
- HerokuSan.project = HerokuSan::Project.new(config_file, :deploy => HerokuSan::Deploy::Sinatra)
54
- load "heroku_san/tasks.rb"
51
+ begin
52
+ require "heroku_san"
53
+ config_file = File.join(File.expand_path(File.dirname(__FILE__)), 'config', 'heroku.yml')
54
+ HerokuSan.project = HerokuSan::Project.new(config_file, :deploy => HerokuSan::Deploy::Sinatra)
55
+ load "heroku_san/tasks.rb"
56
+ rescue LoadError
57
+ # The gem shouldn't be installed in a production environment
58
+ end
55
59
  ```
56
60
 
57
61
  ## Configure
data/cucumber.yml CHANGED
@@ -1,2 +1,3 @@
1
1
  default: --tags ~@slow_process --no-source
2
- remote: --tags @slow_process --no-source
2
+ remote: --tags @slow_process --tags ~@issue --no-source
3
+ issues: --tags @issue --no-source
@@ -0,0 +1,22 @@
1
+ @slow_process @announce-cmd @issue
2
+ Feature: github issues
3
+ Given there are bugs
4
+ And everyone wants defect-free software
5
+ When the bugs are fixed
6
+ Then these tests should be green
7
+
8
+ # https://github.com/fastestforward/heroku_san/issues/113
9
+ # https://github.com/fastestforward/heroku_san/issues/117
10
+ Scenario: Deploying to an annotated tag fails with 'error: Trying to write non-commit object'
11
+ Given I have a new Rails project
12
+ When I am in the project directory
13
+ And I commit any changes with "Initial commit"
14
+ And I add heroku_san to the Gemfile
15
+ And I run bundle install
16
+ And I generate a new config file
17
+ And I create my project on Heroku
18
+ And I generate a scaffold
19
+ And I commit any changes with "Added droids"
20
+ And I tag the commit with "v1.0" annotated by "I am annotated"
21
+ And I deploy to tag "v1.0"
22
+ Then issue 113 has been fixed
@@ -5,7 +5,7 @@ Feature: heroku_san can control a project on Heroku
5
5
  this test; otherwise it will probably hang the first
6
6
  time it tries to do anything with Heroku itself.
7
7
 
8
- Scenario: Installing on a project
8
+ Scenario: Installs a project
9
9
  Given I have a new Rails project
10
10
  When I am in the project directory
11
11
  And I add heroku_san to the Gemfile
@@ -47,6 +47,10 @@ When /^I commit .* changes with "(.*)"$/ do |message|
47
47
  run_clean "git commit -m '#{message}'"
48
48
  end
49
49
 
50
+ When /^I tag the commit with "([^"]*)" annotated by "([^"]*)"$/ do |tag, annotation|
51
+ run_clean "git tag -a '#{tag}' -m '#{annotation}' HEAD"
52
+ end
53
+
50
54
  When /^I add heroku_san to the Gemfile$/ do
51
55
  append_to_file 'Gemfile', <<EOT.strip_heredoc
52
56
  group :development, :test do
@@ -57,9 +61,10 @@ end
57
61
 
58
62
  def run_clean(cmd)
59
63
  Bundler.with_clean_env do
60
- ENV['NOEXEC'] = 'skip'
64
+ ENV['NOEXEC_DISABLE'] = '1'
61
65
  run_simple cmd
62
66
  end
67
+ stdout_from cmd
63
68
  end
64
69
 
65
70
  When /^I run bundle install$/ do
@@ -67,8 +72,7 @@ When /^I run bundle install$/ do
67
72
  end
68
73
 
69
74
  Then /^rake reports that the heroku: tasks are available$/ do
70
- run_clean 'rake -T heroku:'
71
- output = stdout_from 'rake -T heroku:'
75
+ output = run_clean 'rake -T heroku:'
72
76
  assert_partial_output 'rake heroku:apps', output
73
77
  end
74
78
 
@@ -80,8 +84,7 @@ When /^I generate a new config file$/ do
80
84
  end
81
85
 
82
86
  When /^I create a new config\/heroku\.yml file$/ do
83
- run_clean 'rake heroku:create_config'
84
- output = stdout_from 'rake heroku:create_config'
87
+ output = run_clean 'rake heroku:create_config'
85
88
  assert_matching_output %q{Copied example config to ".*.config.heroku.yml"}, output
86
89
  assert_matching_output %q{Please edit ".*.config.heroku.yml" with your application's settings.}, output
87
90
  overwrite_simple_config_file
@@ -89,8 +92,7 @@ end
89
92
 
90
93
  When /^I create my project on Heroku$/ do
91
94
  cmd = 'rake test_app heroku:create'
92
- run_clean unescape(cmd)
93
- output = stdout_from cmd
95
+ output = run_clean unescape(cmd)
94
96
  assert_matching_output %q{test_app: Created ([\w-]+)}, output
95
97
 
96
98
  @app = output.match(/test_app: Created ([\w-]+)/)[1]
@@ -103,7 +105,7 @@ EOT
103
105
  end
104
106
 
105
107
  When /^I curl the app home page$/ do
106
- Godot.match("#{@app}.herokuapp.com", 80, %r{<h1><strong>Heroku | Welcome to your new app!</strong></h1>}).should be, "Heroku didn't spin up a new app"
108
+ vladimir.match(%r{<h1><strong>Heroku | Welcome to your new app!</strong></h1>}).should be, "Heroku didn't spin up a new app"
107
109
  end
108
110
 
109
111
  When /^I configure my project$/ do
@@ -116,29 +118,25 @@ When /^I configure my project$/ do
116
118
 
117
119
  EOT
118
120
  cmd = 'rake test_app heroku:config'
119
- run_clean cmd
120
- output = stdout_from cmd
121
+ output = run_clean cmd
121
122
  assert_partial_output 'DROIDS: marvin', output
122
123
  end
123
124
 
124
125
  When /^I turn maintenance on$/ do
125
- run_clean 'rake test_app heroku:maintenance_on'
126
- output = stdout_from 'rake test_app heroku:maintenance_on'
126
+ output = run_clean 'rake test_app heroku:maintenance_on'
127
127
  assert_partial_output 'test_app: Maintenance mode enabled.', output
128
128
 
129
- Godot.match("#{@app}.herokuapp.com", 80, %r{<title>Offline for Maintenance</title>}).should be, "App is not offline"
129
+ vladimir.match(%r{<title>Offline for Maintenance</title>}).should be, "App is not offline"
130
130
  end
131
131
 
132
132
  When /^I turn maintenance off$/ do
133
- run_clean 'rake test_app heroku:maintenance_off'
134
- output = stdout_from 'rake test_app heroku:maintenance_off'
133
+ output = run_clean 'rake test_app heroku:maintenance_off'
135
134
  assert_partial_output 'test_app: Maintenance mode disabled.', output
136
135
  assert_app_is_running
137
136
  end
138
137
 
139
138
  When /^I restart my project$/ do
140
- run_clean 'rake test_app heroku:restart'
141
- output = stdout_from 'rake test_app heroku:restart'
139
+ output = run_clean 'rake test_app heroku:restart'
142
140
  assert_partial_output 'test_app: Restarted.', output
143
141
  assert_app_is_running
144
142
  end
@@ -162,12 +160,16 @@ When /^I deploy my project$/ do
162
160
  assert_partial_output "http://#{@app}.herokuapp.com deployed to Heroku", all_output
163
161
  end
164
162
 
163
+ When /^I deploy to tag "([^"]*)"$/ do |tag|
164
+ run_clean "rake test_app deploy[#{tag}]"
165
+ assert_partial_output "http://#{@app}.herokuapp.com deployed to Heroku", all_output
166
+ end
167
+
165
168
  When /^I list all apps on Heroku$/ do
166
169
  sha = in_current_dir do
167
170
  `git rev-parse HEAD`.chomp
168
171
  end
169
- run_clean 'rake heroku:apps'
170
- output = stdout_from 'rake heroku:apps'
172
+ output = run_clean 'rake heroku:apps'
171
173
  assert_partial_output "test_app is shorthand for the Heroku app #{@app} located at:", output
172
174
  assert_partial_output "git@heroku.com:#{@app}.git", output
173
175
  assert_partial_output "@ #{sha} master", output
@@ -183,24 +185,29 @@ When /^I install an addon$/ do
183
185
 
184
186
  END_CONFIG
185
187
 
186
- run_clean 'rake test_app heroku:addons'
187
- output = stdout_from 'rake test_app heroku:addons'
188
+ output = run_clean 'rake test_app heroku:addons'
188
189
  # The output should show the new one ...
189
190
  assert_partial_output "deployhooks:campfire", output
190
191
  # ... with a note about needing to configure it.
191
192
  assert_partial_output "https://api.heroku.com/myapps/#{@app}/addons/deployhooks:campfire", output
192
193
  end
193
194
 
194
- Then /^heroku_san is green$/ do
195
+ Then /^(?:heroku_san|issue \d+) (?:is green|has been fixed)$/ do
195
196
  run_clean "heroku apps:destroy #{@app} --confirm #{@app}"
196
197
  end
197
198
 
198
199
  def assert_app_is_running
199
- vladimir = Godot.new("#{@app}.herokuapp.com", 80)
200
- vladimir.timeout = 30
201
200
  vladimir.match(%r{<code>marvin</code>}, 'droids').should be, "http://#{@app}.herokuapp.com/droids are not the droids I'm looking for"
202
201
  end
203
202
 
203
+ def vladimir
204
+ @vladimir ||= begin
205
+ Godot.new("#{@app}.herokuapp.com", 80).tap do |vladimir|
206
+ vladimir.timeout = 60
207
+ end
208
+ end
209
+ end
210
+
204
211
  def overwrite_simple_config_file
205
212
  overwrite_file 'config/heroku.yml', <<EOT.strip_heredoc
206
213
  ---
@@ -12,6 +12,6 @@ Before do
12
12
  end
13
13
 
14
14
  Before('@slow_process') do
15
- @aruba_timeout_seconds = 180
15
+ @aruba_timeout_seconds = 5 * 60
16
16
  # @aruba_io_wait_seconds = 15
17
17
  end
data/lib/git.rb CHANGED
@@ -18,7 +18,7 @@ module Git
18
18
  commit ||= "HEAD"
19
19
  options ||= []
20
20
  begin
21
- sh "git update-ref refs/heroku_san/deploy #{commit}"
21
+ sh "git update-ref refs/heroku_san/deploy #{commit}^{commit}"
22
22
  sh "git push #{repo} #{options.join(' ')} refs/heroku_san/deploy:refs/heads/master"
23
23
  ensure
24
24
  sh "git update-ref -d refs/heroku_san/deploy"
@@ -1,3 +1,3 @@
1
1
  module HerokuSan
2
- VERSION = "4.0.7"
2
+ VERSION = "4.0.8"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Format:
3
- #
3
+ #
4
4
  # <stage name>:
5
5
  # app: <Heroku app name>
6
6
  # stack: <Heroku stack, optional>
@@ -9,7 +9,8 @@
9
9
  # config:
10
10
  # - <Heroku config:var name>: <Heroku config:var value>
11
11
  #
12
- production:
12
+
13
+ production:
13
14
  app: awesomeapp
14
15
  stack: bamboo-ree-1.8.7
15
16
  tag: production/*
@@ -28,6 +29,6 @@ staging:
28
29
  - logging:basic
29
30
  - scheduler:standard
30
31
 
31
- demo:
32
+ demo:
32
33
  app: awesomeapp-demo
33
34
  config: *default
data/spec/git_spec.rb CHANGED
@@ -6,21 +6,21 @@ class GitTest; include Git; end
6
6
  describe GitTest do
7
7
  describe "#git_push" do
8
8
  it "pushes to heroku" do
9
- subject.should_receive(:sh).with("git update-ref refs/heroku_san/deploy HEAD")
9
+ subject.should_receive(:sh).with("git update-ref refs/heroku_san/deploy HEAD^{commit}")
10
10
  subject.should_receive(:sh).with("git push git@heroku.com:awesomeapp.git refs/heroku_san/deploy:refs/heads/master")
11
11
  subject.should_receive(:sh).with("git update-ref -d refs/heroku_san/deploy")
12
12
  subject.git_push(nil, 'git@heroku.com:awesomeapp.git')
13
13
  end
14
14
 
15
15
  it "pushes a specific commit to heroku" do
16
- subject.should_receive(:sh).with("git update-ref refs/heroku_san/deploy kommit")
16
+ subject.should_receive(:sh).with("git update-ref refs/heroku_san/deploy kommit^{commit}")
17
17
  subject.should_receive(:sh).with("git push git@heroku.com:awesomeapp.git refs/heroku_san/deploy:refs/heads/master")
18
18
  subject.should_receive(:sh).with("git update-ref -d refs/heroku_san/deploy")
19
19
  subject.git_push('kommit', 'git@heroku.com:awesomeapp.git')
20
20
  end
21
21
 
22
22
  it "includes options, too" do
23
- subject.should_receive(:sh).with("git update-ref refs/heroku_san/deploy HEAD")
23
+ subject.should_receive(:sh).with("git update-ref refs/heroku_san/deploy HEAD^{commit}")
24
24
  subject.should_receive(:sh).with("git push git@heroku.com:awesomeapp.git --force -v refs/heroku_san/deploy:refs/heads/master")
25
25
  subject.should_receive(:sh).with("git update-ref -d refs/heroku_san/deploy")
26
26
  subject.git_push(nil, 'git@heroku.com:awesomeapp.git', %w[--force -v])
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku_san
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.7
4
+ version: 4.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2012-11-24 00:00:00.000000000 Z
15
+ date: 2013-01-22 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: heroku-api
@@ -194,6 +194,7 @@ files:
194
194
  - examples/push_revision.rake
195
195
  - features/config.feature
196
196
  - features/extended-config.feature
197
+ - features/issue_113.feature
197
198
  - features/remote.feature
198
199
  - features/step_definitions/remote_steps.rb
199
200
  - features/support/env.rb
@@ -212,7 +213,6 @@ files:
212
213
  - lib/railtie.rb
213
214
  - lib/tasks/heroku.rake
214
215
  - lib/templates/heroku.example.yml
215
- - spec/bugs/issue_105_spec.rb
216
216
  - spec/fixtures/example.yml
217
217
  - spec/fixtures/extended_config.yml
218
218
  - spec/fixtures/old_format.yml
@@ -222,6 +222,7 @@ files:
222
222
  - spec/heroku_san/deploy/rails_spec.rb
223
223
  - spec/heroku_san/project_spec.rb
224
224
  - spec/heroku_san/stage_spec.rb
225
+ - spec/issues/issue_105_spec.rb
225
226
  - spec/spec_helper.rb
226
227
  - spec/support/heroku.rb
227
228
  homepage: http://github.com/fastestforward/heroku_san
@@ -239,7 +240,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
239
240
  version: '0'
240
241
  segments:
241
242
  - 0
242
- hash: 3672813808786714588
243
+ hash: 3786976856768330652
243
244
  required_rubygems_version: !ruby/object:Gem::Requirement
244
245
  none: false
245
246
  requirements:
@@ -256,10 +257,10 @@ summary: ! 'A bunch of useful Rake tasks for managing your Heroku apps. NOTE: Th
256
257
  test_files:
257
258
  - features/config.feature
258
259
  - features/extended-config.feature
260
+ - features/issue_113.feature
259
261
  - features/remote.feature
260
262
  - features/step_definitions/remote_steps.rb
261
263
  - features/support/env.rb
262
- - spec/bugs/issue_105_spec.rb
263
264
  - spec/fixtures/example.yml
264
265
  - spec/fixtures/extended_config.yml
265
266
  - spec/fixtures/old_format.yml
@@ -269,5 +270,6 @@ test_files:
269
270
  - spec/heroku_san/deploy/rails_spec.rb
270
271
  - spec/heroku_san/project_spec.rb
271
272
  - spec/heroku_san/stage_spec.rb
273
+ - spec/issues/issue_105_spec.rb
272
274
  - spec/spec_helper.rb
273
275
  - spec/support/heroku.rb