heroku_san 2.1.1 → 2.1.2
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/.travis.yml +5 -0
- data/README.rdoc +2 -1
- data/features/step_definitions/remote_steps.rb +40 -21
- data/lib/heroku_san/version.rb +1 -1
- data/lib/tasks.rb +1 -1
- data/spec/heroku_san/stage_spec.rb +3 -3
- metadata +17 -16
data/.travis.yml
ADDED
data/README.rdoc
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
World(Aruba::Api)
|
2
2
|
|
3
3
|
Given /^I have a new Rails project$/ do
|
4
|
-
# template = File.join(File.expand_path(File.dirname(__FILE__)), '..', '..', 'features', 'data', 'template.rb')
|
5
4
|
cmd = "rails new heroku_san_test --quiet --force --database=postgresql --skip-bundle --skip-javascript --skip-test-unit --skip-sprockets" #" --template #{template}"
|
6
5
|
run_simple unescape(cmd)
|
7
6
|
end
|
@@ -12,9 +11,9 @@ end
|
|
12
11
|
|
13
12
|
When /^I add heroku_san to the Gemfile$/ do
|
14
13
|
append_to_file 'Gemfile', <<EOT
|
15
|
-
group :development, :test do
|
16
|
-
|
17
|
-
end
|
14
|
+
group :development, :test do
|
15
|
+
gem 'heroku_san', :path => '../../../.'
|
16
|
+
end
|
18
17
|
EOT
|
19
18
|
end
|
20
19
|
|
@@ -26,13 +25,16 @@ end
|
|
26
25
|
|
27
26
|
Then /^rake reports that the heroku: tasks are available$/ do
|
28
27
|
run_simple 'rake -T heroku:'
|
29
|
-
|
28
|
+
output = stdout_from 'rake -T heroku:'
|
29
|
+
assert_partial_output 'rake heroku:apps', output
|
30
30
|
end
|
31
31
|
|
32
32
|
When /^I create a new config\/heroku\.yml file$/ do
|
33
33
|
run_simple 'rake heroku:create_config'
|
34
|
-
|
35
|
-
assert_matching_output %q{
|
34
|
+
output = stdout_from 'rake heroku:create_config'
|
35
|
+
assert_matching_output %q{Copied example config to ".*.config.heroku.yml"}, output
|
36
|
+
assert_matching_output %q{Please edit ".*.config.heroku.yml" with your application's settings.}, output
|
37
|
+
|
36
38
|
overwrite_file 'config/heroku.yml', <<EOT
|
37
39
|
---
|
38
40
|
test_app:
|
@@ -42,8 +44,9 @@ end
|
|
42
44
|
When /^I create my project on Heroku$/ do
|
43
45
|
cmd = 'rake test_app heroku:create'
|
44
46
|
run_simple unescape(cmd)
|
45
|
-
assert_matching_output %q{test_app: Created ([\w-]+)}, all_output
|
46
47
|
output = stdout_from cmd
|
48
|
+
assert_matching_output %q{test_app: Created ([\w-]+)}, output
|
49
|
+
|
47
50
|
@app = output.match(/test_app: Created ([\w-]+)/)[1]
|
48
51
|
overwrite_file 'config/heroku.yml', <<EOT
|
49
52
|
---
|
@@ -55,9 +58,10 @@ end
|
|
55
58
|
When /^I list the remote configuration$/ do
|
56
59
|
cmd = 'rake test_app heroku:config:list'
|
57
60
|
run_simple unescape(cmd)
|
58
|
-
assert_partial_output "APP_NAME: #{@app}", all_output
|
59
|
-
assert_partial_output "URL: #{@app}.heroku.com", all_output
|
60
61
|
output = stdout_from cmd
|
62
|
+
assert_partial_output "APP_NAME: #{@app}", output
|
63
|
+
assert_partial_output "URL: #{@app}.heroku.com", output
|
64
|
+
|
61
65
|
@url = output.match(/\bURL:\s+(.*.heroku.com)\b/)[1]
|
62
66
|
@curl = unescape("curl --silent http://#{@url}")
|
63
67
|
end
|
@@ -77,28 +81,33 @@ test_app:
|
|
77
81
|
DROIDS: marvin
|
78
82
|
EOT
|
79
83
|
cmd = 'rake test_app heroku:config'
|
80
|
-
run_simple
|
81
|
-
|
84
|
+
run_simple cmd
|
85
|
+
output = stdout_from cmd
|
86
|
+
assert_partial_output 'DROIDS: marvin', output
|
82
87
|
end
|
83
88
|
|
84
89
|
When /^I turn maintenance on$/ do
|
85
90
|
run_simple 'rake test_app heroku:maintenance_on'
|
86
|
-
|
91
|
+
output = stdout_from 'rake test_app heroku:maintenance_on'
|
92
|
+
assert_partial_output 'test_app: Maintenance mode enabled.', output
|
93
|
+
|
87
94
|
run_simple @curl
|
88
95
|
output = stdout_from @curl
|
89
|
-
assert_partial_output '<title>Offline for Maintenance</title>',
|
96
|
+
assert_partial_output '<title>Offline for Maintenance</title>', output
|
90
97
|
end
|
91
98
|
|
92
99
|
When /^I turn maintenance off$/ do
|
93
100
|
run_simple 'rake test_app heroku:maintenance_off'
|
94
|
-
|
95
|
-
|
96
|
-
|
101
|
+
output = stdout_from 'rake test_app heroku:maintenance_off'
|
102
|
+
assert_partial_output 'test_app: Maintenance mode disabled.', output
|
103
|
+
assert_app_is_running
|
97
104
|
end
|
98
105
|
|
99
106
|
When /^I restart my project$/ do
|
100
107
|
run_simple 'rake test_app heroku:restart'
|
101
|
-
|
108
|
+
output = stdout_from 'rake test_app heroku:restart'
|
109
|
+
assert_partial_output 'test_app: Restarted.', output
|
110
|
+
assert_app_is_running
|
102
111
|
end
|
103
112
|
|
104
113
|
When /^I deploy my project$/ do
|
@@ -112,12 +121,22 @@ When /^I deploy my project$/ do
|
|
112
121
|
end
|
113
122
|
|
114
123
|
When /^I list all apps on Heroku$/ do
|
124
|
+
sha = in_current_dir do
|
125
|
+
`git rev-parse HEAD`.chomp
|
126
|
+
end
|
115
127
|
run_simple 'rake heroku:apps'
|
116
|
-
|
117
|
-
assert_partial_output "
|
118
|
-
|
128
|
+
output = stdout_from 'rake heroku:apps'
|
129
|
+
assert_partial_output "test_app is shorthand for the Heroku app #{@app} located at:", output
|
130
|
+
assert_partial_output "git@heroku.com:#{@app}.git", output
|
131
|
+
assert_partial_output "@ #{sha} master", output
|
119
132
|
end
|
120
133
|
|
121
134
|
Then /^heroku_san is green$/ do
|
122
135
|
run_simple "heroku apps:destroy #{@app} --confirm #{@app}"
|
123
136
|
end
|
137
|
+
|
138
|
+
def assert_app_is_running
|
139
|
+
run_simple @curl + "/droids"
|
140
|
+
output = stdout_from @curl + "/droids"
|
141
|
+
assert_partial_output %Q{<code>marvin</code>}, output
|
142
|
+
end
|
data/lib/heroku_san/version.rb
CHANGED
data/lib/tasks.rb
CHANGED
@@ -109,7 +109,7 @@ namespace :heroku do
|
|
109
109
|
puts command
|
110
110
|
config = Hash[`#{command}`.scan(/^(.+?)\s*=>\s*(.+)$/)]
|
111
111
|
if config['RACK_ENV'] != stage.name
|
112
|
-
puts stage.push_config RACK_ENV
|
112
|
+
puts stage.push_config 'RACK_ENV' => stage.name
|
113
113
|
end
|
114
114
|
end
|
115
115
|
end
|
@@ -112,8 +112,8 @@ describe HerokuSan::Stage do
|
|
112
112
|
|
113
113
|
context "with a block" do
|
114
114
|
it "wraps it in a maitenance mode" do
|
115
|
-
reactor = mock("Reactor"); reactor.should_receive(:scram).with(:now).ordered
|
116
115
|
@heroku_client.should_receive(:maintenance).with('awesomeapp', :on).ordered
|
116
|
+
reactor = mock("Reactor"); reactor.should_receive(:scram).with(:now).ordered
|
117
117
|
@heroku_client.should_receive(:maintenance).with('awesomeapp', :off).ordered
|
118
118
|
subject.maintenance do reactor.scram(:now) end
|
119
119
|
end
|
@@ -186,13 +186,13 @@ describe HerokuSan::Stage do
|
|
186
186
|
|
187
187
|
describe "#push_config" do
|
188
188
|
it "updates the configuration settings on Heroku" do
|
189
|
-
subject = HerokuSan::Stage.new('test', {"app" => "awesomeapp", "config" => {FOO
|
189
|
+
subject = HerokuSan::Stage.new('test', {"app" => "awesomeapp", "config" => {:FOO => 'bar', :DOG => 'emu'}})
|
190
190
|
@heroku_client.should_receive(:add_config_vars).with('awesomeapp', {:FOO => 'bar', :DOG => 'emu'}).and_return("{}")
|
191
191
|
subject.push_config
|
192
192
|
end
|
193
193
|
it "pushes the options hash" do
|
194
194
|
@heroku_client.should_receive(:add_config_vars).with('awesomeapp', {:RACK_ENV => 'magic'}).and_return("{}")
|
195
|
-
subject.push_config(RACK_ENV
|
195
|
+
subject.push_config(:RACK_ENV => 'magic')
|
196
196
|
end
|
197
197
|
end
|
198
198
|
|
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: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,11 +12,11 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2012-03-
|
15
|
+
date: 2012-03-29 00:00:00.000000000Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rails
|
19
|
-
requirement: &
|
19
|
+
requirement: &2152396440 !ruby/object:Gem::Requirement
|
20
20
|
none: false
|
21
21
|
requirements:
|
22
22
|
- - ! '>='
|
@@ -24,10 +24,10 @@ dependencies:
|
|
24
24
|
version: '2'
|
25
25
|
type: :development
|
26
26
|
prerelease: false
|
27
|
-
version_requirements: *
|
27
|
+
version_requirements: *2152396440
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: heroku
|
30
|
-
requirement: &
|
30
|
+
requirement: &2152385600 !ruby/object:Gem::Requirement
|
31
31
|
none: false
|
32
32
|
requirements:
|
33
33
|
- - ! '>='
|
@@ -35,10 +35,10 @@ dependencies:
|
|
35
35
|
version: '2'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
|
-
version_requirements: *
|
38
|
+
version_requirements: *2152385600
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: rake
|
41
|
-
requirement: &
|
41
|
+
requirement: &2152384980 !ruby/object:Gem::Requirement
|
42
42
|
none: false
|
43
43
|
requirements:
|
44
44
|
- - ! '>='
|
@@ -46,10 +46,10 @@ dependencies:
|
|
46
46
|
version: '0'
|
47
47
|
type: :runtime
|
48
48
|
prerelease: false
|
49
|
-
version_requirements: *
|
49
|
+
version_requirements: *2152384980
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: aruba
|
52
|
-
requirement: &
|
52
|
+
requirement: &2152384220 !ruby/object:Gem::Requirement
|
53
53
|
none: false
|
54
54
|
requirements:
|
55
55
|
- - ! '>='
|
@@ -57,10 +57,10 @@ dependencies:
|
|
57
57
|
version: '0'
|
58
58
|
type: :development
|
59
59
|
prerelease: false
|
60
|
-
version_requirements: *
|
60
|
+
version_requirements: *2152384220
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: cucumber
|
63
|
-
requirement: &
|
63
|
+
requirement: &2152383620 !ruby/object:Gem::Requirement
|
64
64
|
none: false
|
65
65
|
requirements:
|
66
66
|
- - ! '>='
|
@@ -68,10 +68,10 @@ dependencies:
|
|
68
68
|
version: '0'
|
69
69
|
type: :development
|
70
70
|
prerelease: false
|
71
|
-
version_requirements: *
|
71
|
+
version_requirements: *2152383620
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
73
|
name: rake
|
74
|
-
requirement: &
|
74
|
+
requirement: &2152382980 !ruby/object:Gem::Requirement
|
75
75
|
none: false
|
76
76
|
requirements:
|
77
77
|
- - ! '>='
|
@@ -79,10 +79,10 @@ dependencies:
|
|
79
79
|
version: '0'
|
80
80
|
type: :development
|
81
81
|
prerelease: false
|
82
|
-
version_requirements: *
|
82
|
+
version_requirements: *2152382980
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
|
-
requirement: &
|
85
|
+
requirement: &2152382280 !ruby/object:Gem::Requirement
|
86
86
|
none: false
|
87
87
|
requirements:
|
88
88
|
- - ~>
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
version: '1.1'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
|
-
version_requirements: *
|
93
|
+
version_requirements: *2152382280
|
94
94
|
description: Manage multiple Heroku instances/apps for a single Rails app using Rake
|
95
95
|
email: elijah.miller@gmail.com
|
96
96
|
executables: []
|
@@ -100,6 +100,7 @@ extra_rdoc_files:
|
|
100
100
|
files:
|
101
101
|
- .gitignore
|
102
102
|
- .rvmrc
|
103
|
+
- .travis.yml
|
103
104
|
- CHANGELOG.md
|
104
105
|
- Gemfile
|
105
106
|
- LICENSE
|