jumpup-heroku 0.0.1 → 0.0.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.
- checksums.yaml +4 -4
- data/{LICENSE.txt → LICENSE} +0 -0
- data/README.md +28 -12
- data/Rakefile +13 -0
- data/lib/jumpup/heroku/configuration.rb +13 -1
- data/lib/jumpup/heroku/env.rb +2 -1
- data/lib/jumpup/heroku/integrate.rb +12 -8
- data/lib/jumpup/heroku/version.rb +1 -1
- data/lib/tasks/integrate.rake +3 -0
- data/spec/jumpup/heroku/configuration_spec.rb +128 -47
- data/spec/jumpup/heroku/env_spec.rb +3 -17
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1138bd5883940e7d6c8ebbe05eeed5168a684078
|
4
|
+
data.tar.gz: 7222d1259b990b16981e38ca4e008f9776b625dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74e2825fe8e235c3258f3edb51de1e977bff25b1edee1b32d1770a5139cfa5e350de7e30470adfa155119b82c0fda947864911f2449ed17ddb404ae69fdfb260
|
7
|
+
data.tar.gz: a2bf33ba4f153b5469460f894861d29c6597689f0006464d90ac847aaca9fe1878901f9bda99f7e153e4a0a27b8e4038dfd89bd66ee3c3f3a76e8bc61a88a6f7
|
data/{LICENSE.txt → LICENSE}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Jumpup-heroku
|
2
2
|
|
3
|
-
Rake tasks to deploy on heroku.
|
3
|
+
Rake tasks to deploy any Rails application on [Heroku](http://heroku.com) using [Jumpup](https://github.com/Helabs/jumpup).
|
4
4
|
|
5
5
|
## Instalation
|
6
6
|
|
@@ -21,6 +21,21 @@ Without groups on Gemfile, because of initializer.
|
|
21
21
|
Jumpup::Heroku.configure do |config|
|
22
22
|
config.app = 'myapp'
|
23
23
|
end
|
24
|
+
```
|
25
|
+
|
26
|
+
If you use [Heroku Accounts](https://github.com/ddollar/heroku-accounts)
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
# config/initializers/jumpup-heroku.rb
|
30
|
+
Jumpup::Heroku.configure do |config|
|
31
|
+
config.account(:name_of_account1) do |account1|
|
32
|
+
account1.app = 'myapp1'
|
33
|
+
end
|
34
|
+
config.account(:name_of_account2) do |account2|
|
35
|
+
account2.app = 'myapp2'
|
36
|
+
account2.run_database_tasks = false # Default: true
|
37
|
+
end
|
38
|
+
end
|
24
39
|
```
|
25
40
|
|
26
41
|
Have production and staging app? Do like this:
|
@@ -41,23 +56,20 @@ Without groups on Gemfile, because of initializer.
|
|
41
56
|
end
|
42
57
|
```
|
43
58
|
|
44
|
-
2. Add to the tasks on
|
59
|
+
2. Add to the tasks on jumpup.rake the tasks to deploy on Heroku:
|
45
60
|
|
46
61
|
```ruby
|
47
|
-
#
|
62
|
+
# lib/tasks/jumpup.rake
|
48
63
|
|
49
64
|
INTEGRATION_TASKS = %w(
|
50
|
-
jumpup:heroku:
|
51
|
-
jumpup:
|
52
|
-
jumpup:
|
53
|
-
integration:start
|
54
|
-
integration:bundle_install
|
65
|
+
jumpup:heroku:start
|
66
|
+
jumpup:start
|
67
|
+
jumpup:bundle_install
|
55
68
|
db:migrate
|
56
69
|
spec
|
57
|
-
|
58
|
-
|
59
|
-
jumpup:heroku:
|
60
|
-
jumpup:heroku:unlock
|
70
|
+
jumpup:coverage_verify
|
71
|
+
jumpup:finish
|
72
|
+
jumpup:heroku:finish
|
61
73
|
)
|
62
74
|
```
|
63
75
|
|
@@ -77,3 +89,7 @@ Please see [CONTRIBUTING.md](https://github.com/Helabs/jumpup-heroku/blob/master
|
|
77
89
|
|
78
90
|
Jumpup-heroku is maintained and funded by [HE:labs](http://helabs.com.br/opensource/).
|
79
91
|
Thank you to all the [contributors](https://github.com/Helabs/jumpup-heroku/graphs/contributors).
|
92
|
+
|
93
|
+
## License
|
94
|
+
|
95
|
+
Jumpup-heroku is Copyright © 2013-2014 HE:labs. It is free software, and may be redistributed under the terms specified in the LICENSE file.
|
data/Rakefile
CHANGED
@@ -1 +1,14 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
+
|
3
|
+
require 'rspec/core'
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
6
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
7
|
+
end
|
8
|
+
|
9
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
10
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
11
|
+
spec.rcov = true
|
12
|
+
end
|
13
|
+
|
14
|
+
task :default => :spec
|
@@ -12,10 +12,18 @@ module Jumpup
|
|
12
12
|
|
13
13
|
|
14
14
|
class Configuration
|
15
|
-
attr_accessor :app, :staging_app, :production_app, :run_database_tasks
|
15
|
+
attr_accessor :app, :staging_app, :production_app, :run_database_tasks, :host
|
16
16
|
|
17
17
|
def initialize
|
18
18
|
@run_database_tasks ||= true
|
19
|
+
@host ||= 'heroku.com'
|
20
|
+
end
|
21
|
+
|
22
|
+
def account(account_token)
|
23
|
+
if account_token == current_account
|
24
|
+
self.host = "heroku.#{account_token}"
|
25
|
+
yield(self)
|
26
|
+
end
|
19
27
|
end
|
20
28
|
|
21
29
|
def valid?
|
@@ -24,6 +32,10 @@ module Jumpup
|
|
24
32
|
|
25
33
|
private
|
26
34
|
|
35
|
+
def current_account
|
36
|
+
(ENV["HEROKU_ACCOUNT"] || %x{ git config heroku.account }.chomp).to_sym
|
37
|
+
end
|
38
|
+
|
27
39
|
def only_app?
|
28
40
|
app && staging_app.nil? && production_app.nil?
|
29
41
|
end
|
data/lib/jumpup/heroku/env.rb
CHANGED
@@ -9,7 +9,8 @@ module Jumpup
|
|
9
9
|
app: Jumpup::Heroku.configuration.app,
|
10
10
|
staging_app: Jumpup::Heroku.configuration.staging_app,
|
11
11
|
production_app: Jumpup::Heroku.configuration.production_app,
|
12
|
-
run_database_tasks: Jumpup::Heroku.configuration.run_database_tasks
|
12
|
+
run_database_tasks: Jumpup::Heroku.configuration.run_database_tasks,
|
13
|
+
host: Jumpup::Heroku.configuration.host
|
13
14
|
}.delete_if { |k, v| v.nil? }
|
14
15
|
else
|
15
16
|
error_message = 'Check your `/config/initializers/jumpup-heroku.rb` and ' \
|
@@ -113,30 +113,30 @@ module Jumpup
|
|
113
113
|
|
114
114
|
def backup
|
115
115
|
return unless run_database_tasks?
|
116
|
-
puts "--> Backing up database
|
116
|
+
puts "--> [#{app}] Backing up database"
|
117
117
|
run_with_clean_env("heroku pgbackups:capture --expire --app #{app}")
|
118
118
|
end
|
119
119
|
|
120
120
|
def migrate
|
121
121
|
return unless run_database_tasks?
|
122
|
-
puts "--> Migrating"
|
122
|
+
puts "--> [#{app}] Migrating"
|
123
123
|
run_with_clean_env("heroku run rake db:migrate --app #{app}")
|
124
124
|
end
|
125
125
|
|
126
126
|
def seed
|
127
127
|
return unless run_database_tasks?
|
128
|
-
puts "--> Seeding"
|
128
|
+
puts "--> [#{app}] Seeding"
|
129
129
|
run_with_clean_env("heroku run rake db:seed --app #{app}")
|
130
130
|
end
|
131
131
|
|
132
132
|
def restart
|
133
|
-
puts "--> Restarting"
|
133
|
+
puts "--> [#{app}] Restarting"
|
134
134
|
run_with_clean_env("heroku restart --app #{app}")
|
135
135
|
end
|
136
136
|
|
137
137
|
def push
|
138
|
-
puts "--> Pushing"
|
139
|
-
run_with_clean_env("git push git
|
138
|
+
puts "--> [#{app}] Pushing to #{host}"
|
139
|
+
run_with_clean_env("git push git@#{host}:#{app}.git HEAD:master")
|
140
140
|
end
|
141
141
|
|
142
142
|
def confirm_deploy
|
@@ -159,10 +159,10 @@ module Jumpup
|
|
159
159
|
|
160
160
|
def maintenance
|
161
161
|
if maintenance?
|
162
|
-
puts "--> Setting Maintenance on"
|
162
|
+
puts "--> [#{app}] Setting Maintenance on"
|
163
163
|
run_with_clean_env("heroku maintenance:on --app #{app}")
|
164
164
|
restart
|
165
|
-
puts "--> Waiting 20 seconds to app come back (in maintenance mode)"
|
165
|
+
puts "--> [#{app}] Waiting 20 seconds to app come back (in maintenance mode)"
|
166
166
|
sleep(20)
|
167
167
|
end
|
168
168
|
end
|
@@ -184,6 +184,10 @@ module Jumpup
|
|
184
184
|
run_with_clean_env("heroku maintenance:off --app #{app}")
|
185
185
|
end
|
186
186
|
end
|
187
|
+
|
188
|
+
def host
|
189
|
+
Env.all[:host]
|
190
|
+
end
|
187
191
|
end
|
188
192
|
end
|
189
193
|
end
|
data/lib/tasks/integrate.rake
CHANGED
@@ -1,82 +1,192 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Jumpup::Heroku::Configuration do
|
4
|
-
|
5
4
|
before do
|
6
5
|
Jumpup::Heroku.configuration = nil
|
7
6
|
end
|
8
|
-
|
9
7
|
describe ".configure" do
|
10
|
-
|
11
8
|
describe "without configuration" do
|
12
9
|
before do
|
13
10
|
Jumpup::Heroku.configure do |config|
|
14
11
|
end
|
15
12
|
end
|
16
|
-
|
17
13
|
subject do
|
18
14
|
Jumpup::Heroku.configuration
|
19
15
|
end
|
20
|
-
|
21
16
|
its(:app) { should be_nil }
|
22
17
|
its(:staging_app) { should be_nil }
|
23
18
|
its(:production_app) { should be_nil }
|
24
19
|
its(:run_database_tasks) { should be_true }
|
20
|
+
its(:host) { should == 'heroku.com' }
|
25
21
|
end
|
26
|
-
|
27
22
|
describe "with configurations" do
|
28
|
-
|
29
23
|
before do
|
30
24
|
Jumpup::Heroku.configure do |config|
|
31
25
|
config.app = 'myapp'
|
32
26
|
config.production_app = 'myapp-production'
|
33
27
|
config.staging_app = 'myapp-staging'
|
34
28
|
config.run_database_tasks = false
|
29
|
+
config.host = 'myhost.com'
|
35
30
|
end
|
36
31
|
end
|
37
|
-
|
38
32
|
subject do
|
39
33
|
Jumpup::Heroku.configuration
|
40
34
|
end
|
41
|
-
|
42
35
|
its(:app) { should eq('myapp') }
|
43
36
|
its(:staging_app) { should eq('myapp-staging')}
|
44
37
|
its(:production_app) { should eq('myapp-production') }
|
45
38
|
its(:run_database_tasks) { should be_false }
|
39
|
+
its(:host) { should eq('myhost.com') }
|
40
|
+
end
|
41
|
+
describe "with multiple accounts" do
|
42
|
+
context "first account" do
|
43
|
+
before { ENV.stub(:[]).with("HEROKU_ACCOUNT").and_return("first") }
|
44
|
+
before do
|
45
|
+
Jumpup::Heroku.configure do |config|
|
46
|
+
config.run_database_tasks = false
|
47
|
+
config.account(:first) do |first|
|
48
|
+
first.app = 'myapp1'
|
49
|
+
first.production_app = 'myapp1-production'
|
50
|
+
first.staging_app = 'myapp1-staging'
|
51
|
+
end
|
52
|
+
config.account(:second) do |second|
|
53
|
+
second.app = 'myapp2'
|
54
|
+
second.production_app = 'myapp2-production'
|
55
|
+
second.staging_app = 'myapp2-staging'
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
subject do
|
60
|
+
Jumpup::Heroku.configuration
|
61
|
+
end
|
62
|
+
its(:app) { should eq('myapp1') }
|
63
|
+
its(:staging_app) { should eq('myapp1-staging')}
|
64
|
+
its(:production_app) { should eq('myapp1-production') }
|
65
|
+
its(:run_database_tasks) { should be_false }
|
66
|
+
its(:host) { should eq('heroku.first') }
|
67
|
+
end
|
68
|
+
context "second account with default values" do
|
69
|
+
before { ENV.stub(:[]).with("HEROKU_ACCOUNT").and_return("second") }
|
70
|
+
before do
|
71
|
+
Jumpup::Heroku.configure do |config|
|
72
|
+
config.app = 'myapp1'
|
73
|
+
config.production_app = 'myapp1-production'
|
74
|
+
config.staging_app = 'myapp1-staging'
|
75
|
+
config.run_database_tasks = true
|
76
|
+
config.account(:second) do |second|
|
77
|
+
second.app = 'myapp2'
|
78
|
+
second.production_app = 'myapp2-production'
|
79
|
+
second.staging_app = 'myapp2-staging'
|
80
|
+
second.run_database_tasks = false
|
81
|
+
second.host = 'mysecondhost.com'
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
subject do
|
86
|
+
Jumpup::Heroku.configuration
|
87
|
+
end
|
88
|
+
its(:app) { should eq('myapp2') }
|
89
|
+
its(:staging_app) { should eq('myapp2-staging')}
|
90
|
+
its(:production_app) { should eq('myapp2-production') }
|
91
|
+
its(:run_database_tasks) { should be_false }
|
92
|
+
its(:host) { should eq('mysecondhost.com') }
|
93
|
+
end
|
94
|
+
context "other account" do
|
95
|
+
before { ENV.stub(:[]).with("HEROKU_ACCOUNT").and_return("third") }
|
96
|
+
before do
|
97
|
+
Jumpup::Heroku.configure do |config|
|
98
|
+
config.account(:first) do |first|
|
99
|
+
first.app = 'myapp1'
|
100
|
+
first.production_app = 'myapp1-production'
|
101
|
+
first.staging_app = 'myapp1-staging'
|
102
|
+
end
|
103
|
+
config.account(:second) do |second|
|
104
|
+
second.app = 'myapp2'
|
105
|
+
second.production_app = 'myapp2-production'
|
106
|
+
second.staging_app = 'myapp2-staging'
|
107
|
+
end
|
108
|
+
config.run_database_tasks = false
|
109
|
+
end
|
110
|
+
end
|
111
|
+
subject do
|
112
|
+
Jumpup::Heroku.configuration
|
113
|
+
end
|
114
|
+
its(:app) { should be_nil }
|
115
|
+
its(:staging_app) { should be_nil }
|
116
|
+
its(:production_app) { should be_nil }
|
117
|
+
its(:run_database_tasks) { should be_false }
|
118
|
+
its(:host) { should eq('heroku.com') }
|
119
|
+
end
|
120
|
+
context "without heroku accounts installed" do
|
121
|
+
before { Jumpup::Heroku::Configuration.any_instance.stub(:current_account).and_return(:"") }
|
122
|
+
before do
|
123
|
+
Jumpup::Heroku.configure do |config|
|
124
|
+
config.account(:second) do |second|
|
125
|
+
second.app = 'myapp2'
|
126
|
+
second.production_app = 'myapp2-production'
|
127
|
+
second.staging_app = 'myapp2-staging'
|
128
|
+
config.run_database_tasks = false
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
subject do
|
133
|
+
Jumpup::Heroku.configuration
|
134
|
+
end
|
135
|
+
its(:app) { should be_nil }
|
136
|
+
its(:staging_app) { should be_nil }
|
137
|
+
its(:production_app) { should be_nil }
|
138
|
+
its(:run_database_tasks) { should be_true }
|
139
|
+
its(:host) { should eq('heroku.com') }
|
140
|
+
end
|
141
|
+
context "without herou accounts installed and default values" do
|
142
|
+
before { Jumpup::Heroku::Configuration.any_instance.stub(:current_account).and_return(:"") }
|
143
|
+
before do
|
144
|
+
Jumpup::Heroku.configure do |config|
|
145
|
+
config.app = 'myapp1'
|
146
|
+
config.production_app = 'myapp1-production'
|
147
|
+
config.staging_app = 'myapp1-staging'
|
148
|
+
config.run_database_tasks = true
|
149
|
+
config.account(:second) do |second|
|
150
|
+
second.app = 'myapp2'
|
151
|
+
second.production_app = 'myapp2-production'
|
152
|
+
second.staging_app = 'myapp2-staging'
|
153
|
+
config.run_database_tasks = false
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
subject do
|
158
|
+
Jumpup::Heroku.configuration
|
159
|
+
end
|
160
|
+
its(:app) { should eq('myapp1') }
|
161
|
+
its(:staging_app) { should eq('myapp1-staging')}
|
162
|
+
its(:production_app) { should eq('myapp1-production') }
|
163
|
+
its(:run_database_tasks) { should be_true }
|
164
|
+
end
|
46
165
|
end
|
47
166
|
end
|
48
|
-
|
49
167
|
describe "#valid?" do
|
50
|
-
|
51
168
|
describe "with app" do
|
52
|
-
|
53
169
|
before do
|
54
170
|
Jumpup::Heroku.configure do |config|
|
55
171
|
config.app = 'myapp'
|
56
172
|
end
|
57
173
|
end
|
58
|
-
|
59
174
|
it 'be valid' do
|
60
175
|
expect(Jumpup::Heroku.configuration).to be_valid
|
61
176
|
end
|
62
177
|
end
|
63
|
-
|
64
178
|
describe "with staging_app and production_app" do
|
65
|
-
|
66
179
|
before do
|
67
180
|
Jumpup::Heroku.configure do |config|
|
68
181
|
config.production_app = 'myapp-production'
|
69
182
|
config.staging_app = 'myapp-staging'
|
70
183
|
end
|
71
184
|
end
|
72
|
-
|
73
185
|
it 'be valid' do
|
74
186
|
expect(Jumpup::Heroku.configuration).to be_valid
|
75
187
|
end
|
76
188
|
end
|
77
|
-
|
78
189
|
describe "with app, staging_app and production_app" do
|
79
|
-
|
80
190
|
before do
|
81
191
|
Jumpup::Heroku.configure do |config|
|
82
192
|
config.app = 'myapp'
|
@@ -84,126 +194,98 @@ describe Jumpup::Heroku::Configuration do
|
|
84
194
|
config.staging_app = 'myapp-staging'
|
85
195
|
end
|
86
196
|
end
|
87
|
-
|
88
197
|
it 'not be valid' do
|
89
198
|
expect(Jumpup::Heroku.configuration).to_not be_valid
|
90
199
|
end
|
91
200
|
end
|
92
|
-
|
93
201
|
describe "with staging_app" do
|
94
|
-
|
95
202
|
before do
|
96
203
|
Jumpup::Heroku.configure do |config|
|
97
204
|
config.staging_app = 'myapp-staging'
|
98
205
|
end
|
99
206
|
end
|
100
|
-
|
101
207
|
it 'not be valid' do
|
102
208
|
expect(Jumpup::Heroku.configuration).to_not be_valid
|
103
209
|
end
|
104
210
|
end
|
105
|
-
|
106
211
|
describe "with production_app" do
|
107
|
-
|
108
212
|
before do
|
109
213
|
Jumpup::Heroku.configure do |config|
|
110
214
|
config.production_app = 'myapp-production'
|
111
215
|
end
|
112
216
|
end
|
113
|
-
|
114
217
|
it 'not be valid' do
|
115
218
|
expect(Jumpup::Heroku.configuration).to_not be_valid
|
116
219
|
end
|
117
220
|
end
|
118
|
-
|
119
221
|
describe "with app and production_app" do
|
120
|
-
|
121
222
|
before do
|
122
223
|
Jumpup::Heroku.configure do |config|
|
123
224
|
config.app = 'myapp'
|
124
225
|
config.production_app = 'myapp-production'
|
125
226
|
end
|
126
227
|
end
|
127
|
-
|
128
228
|
it 'not be valid' do
|
129
229
|
expect(Jumpup::Heroku.configuration).to_not be_valid
|
130
230
|
end
|
131
231
|
end
|
132
|
-
|
133
232
|
describe "with app and staging_app" do
|
134
|
-
|
135
233
|
before do
|
136
234
|
Jumpup::Heroku.configure do |config|
|
137
235
|
config.app = 'myapp'
|
138
236
|
config.staging_app = 'myapp-staging'
|
139
237
|
end
|
140
238
|
end
|
141
|
-
|
142
239
|
it 'not be valid' do
|
143
240
|
expect(Jumpup::Heroku.configuration).to_not be_valid
|
144
241
|
end
|
145
242
|
end
|
146
|
-
|
147
243
|
describe "with true run_database_tasks" do
|
148
|
-
|
149
244
|
before do
|
150
245
|
Jumpup::Heroku.configure do |config|
|
151
246
|
config.app = 'myapp'
|
152
247
|
config.run_database_tasks = true
|
153
248
|
end
|
154
249
|
end
|
155
|
-
|
156
250
|
it 'be valid' do
|
157
251
|
expect(Jumpup::Heroku.configuration).to be_valid
|
158
252
|
end
|
159
253
|
end
|
160
|
-
|
161
254
|
describe "with false run_database_tasks" do
|
162
|
-
|
163
255
|
before do
|
164
256
|
Jumpup::Heroku.configure do |config|
|
165
257
|
config.app = 'myapp'
|
166
258
|
config.run_database_tasks = false
|
167
259
|
end
|
168
260
|
end
|
169
|
-
|
170
261
|
it 'be valid' do
|
171
262
|
expect(Jumpup::Heroku.configuration).to be_valid
|
172
263
|
end
|
173
264
|
end
|
174
|
-
|
175
265
|
describe "with invalid run_database_tasks" do
|
176
|
-
|
177
266
|
before do
|
178
267
|
Jumpup::Heroku.configure do |config|
|
179
268
|
config.app = 'myapp'
|
180
269
|
config.run_database_tasks = 'a'
|
181
270
|
end
|
182
271
|
end
|
183
|
-
|
184
272
|
it 'be valid' do
|
185
273
|
expect(Jumpup::Heroku.configuration).to_not be_valid
|
186
274
|
end
|
187
275
|
end
|
188
|
-
|
189
276
|
describe "without configuration" do
|
190
|
-
|
191
277
|
before do
|
192
278
|
Jumpup::Heroku.configure do |config|
|
193
279
|
end
|
194
280
|
end
|
195
|
-
|
196
281
|
it 'not be valid' do
|
197
282
|
expect(Jumpup::Heroku.configuration).to_not be_valid
|
198
283
|
end
|
199
284
|
end
|
200
|
-
|
201
285
|
describe "with configuration nil" do
|
202
|
-
|
203
286
|
before do
|
204
287
|
Jumpup::Heroku.configuration = nil
|
205
288
|
end
|
206
|
-
|
207
289
|
it 'not be valid' do
|
208
290
|
pending "The bug is raised when have no config/initialier/heroku-deploy.rb file"
|
209
291
|
expect(Jumpup::Heroku.configuration).to_not be_valid
|
@@ -211,4 +293,3 @@ describe Jumpup::Heroku::Configuration do
|
|
211
293
|
end
|
212
294
|
end
|
213
295
|
end
|
214
|
-
|
@@ -1,56 +1,44 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Jumpup::Heroku::Env do
|
4
|
-
|
5
4
|
before do
|
6
5
|
Jumpup::Heroku.configuration = nil
|
7
6
|
end
|
8
|
-
|
9
7
|
describe "with app" do
|
10
|
-
|
11
8
|
before do
|
12
9
|
Jumpup::Heroku.configure do |config|
|
13
10
|
config.app = 'myapp'
|
14
11
|
end
|
15
12
|
end
|
16
|
-
|
17
13
|
it "have correct env info" do
|
18
|
-
expect(Jumpup::Heroku::Env.all).to eq({ app: 'myapp', run_database_tasks: true })
|
14
|
+
expect(Jumpup::Heroku::Env.all).to eq({ app: 'myapp', run_database_tasks: true, host: 'heroku.com' })
|
19
15
|
end
|
20
16
|
end
|
21
|
-
|
22
17
|
describe "with staging_app and production_app" do
|
23
|
-
|
24
18
|
before do
|
25
19
|
Jumpup::Heroku.configure do |config|
|
26
20
|
config.production_app = 'myapp-production'
|
27
21
|
config.staging_app = 'myapp-staging'
|
28
22
|
end
|
29
23
|
end
|
30
|
-
|
31
24
|
it "have correct env info" do
|
32
|
-
result = { production_app: 'myapp-production', staging_app: 'myapp-staging', run_database_tasks: true }
|
25
|
+
result = { production_app: 'myapp-production', staging_app: 'myapp-staging', run_database_tasks: true, host: 'heroku.com' }
|
33
26
|
expect(Jumpup::Heroku::Env.all).to eq(result)
|
34
27
|
end
|
35
28
|
end
|
36
|
-
|
37
29
|
describe "with run_database_tasks" do
|
38
|
-
|
39
30
|
before do
|
40
31
|
Jumpup::Heroku.configure do |config|
|
41
32
|
config.app = 'myapp'
|
42
33
|
config.run_database_tasks = false
|
43
34
|
end
|
44
35
|
end
|
45
|
-
|
46
36
|
it "have correct env info" do
|
47
|
-
result = { app: 'myapp', run_database_tasks: false }
|
37
|
+
result = { app: 'myapp', run_database_tasks: false, host: 'heroku.com' }
|
48
38
|
expect(Jumpup::Heroku::Env.all).to eq(result)
|
49
39
|
end
|
50
40
|
end
|
51
|
-
|
52
41
|
describe "with a invalid config env" do
|
53
|
-
|
54
42
|
before do
|
55
43
|
Jumpup::Heroku.configure do |config|
|
56
44
|
config.app = 'myapp'
|
@@ -59,7 +47,6 @@ describe Jumpup::Heroku::Env do
|
|
59
47
|
config.run_database_tasks = 'a'
|
60
48
|
end
|
61
49
|
end
|
62
|
-
|
63
50
|
it 'raise error' do
|
64
51
|
expect do
|
65
52
|
Jumpup::Heroku::Env.all
|
@@ -67,4 +54,3 @@ describe Jumpup::Heroku::Env do
|
|
67
54
|
end
|
68
55
|
end
|
69
56
|
end
|
70
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jumpup-heroku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HE:labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -65,7 +65,7 @@ files:
|
|
65
65
|
- CHANGELOG.md
|
66
66
|
- CONTRIBUTING.md
|
67
67
|
- Gemfile
|
68
|
-
- LICENSE
|
68
|
+
- LICENSE
|
69
69
|
- README.md
|
70
70
|
- Rakefile
|
71
71
|
- jumpup-heroku.gemspec
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
101
|
rubyforge_project:
|
102
|
-
rubygems_version: 2.
|
102
|
+
rubygems_version: 2.2.1
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
105
|
summary: Rake tasks to deploy on heroku
|