engineyard 1.4.29 → 1.7.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +139 -4
- data/bin/ey +1 -7
- data/lib/engineyard.rb +1 -22
- data/lib/engineyard/cli.rb +192 -94
- data/lib/engineyard/cli/#recipes.rb# +32 -0
- data/lib/engineyard/cli/api.rb +42 -28
- data/lib/engineyard/cli/recipes.rb +13 -6
- data/lib/engineyard/cli/ui.rb +103 -42
- data/lib/engineyard/cli/web.rb +16 -10
- data/lib/engineyard/config.rb +92 -18
- data/lib/engineyard/deploy_config.rb +66 -0
- data/lib/engineyard/deploy_config/migrate.rb +125 -0
- data/lib/engineyard/deploy_config/ref.rb +56 -0
- data/lib/engineyard/error.rb +38 -78
- data/lib/engineyard/repo.rb +75 -27
- data/lib/engineyard/serverside_runner.rb +133 -0
- data/lib/engineyard/thor.rb +110 -18
- data/lib/engineyard/version.rb +1 -1
- data/spec/engineyard/cli/api_spec.rb +10 -16
- data/spec/engineyard/cli_spec.rb +0 -11
- data/spec/engineyard/config_spec.rb +1 -8
- data/spec/engineyard/deploy_config_spec.rb +203 -0
- data/spec/engineyard/eyrc_spec.rb +2 -0
- data/spec/engineyard/repo_spec.rb +57 -34
- data/spec/ey/deploy_spec.rb +102 -52
- data/spec/ey/list_environments_spec.rb +69 -14
- data/spec/ey/login_spec.rb +11 -7
- data/spec/ey/logout_spec.rb +4 -4
- data/spec/ey/logs_spec.rb +6 -6
- data/spec/ey/recipes/apply_spec.rb +1 -1
- data/spec/ey/recipes/download_spec.rb +1 -1
- data/spec/ey/recipes/upload_spec.rb +6 -6
- data/spec/ey/rollback_spec.rb +3 -3
- data/spec/ey/ssh_spec.rb +9 -9
- data/spec/ey/status_spec.rb +2 -2
- data/spec/ey/whoami_spec.rb +9 -8
- data/spec/spec_helper.rb +18 -15
- data/spec/support/{fake_awsm.rb → git_repos.rb} +0 -14
- data/spec/support/helpers.rb +84 -28
- data/spec/support/matchers.rb +0 -16
- data/spec/support/shared_behavior.rb +83 -103
- metadata +65 -51
- data/lib/engineyard/api.rb +0 -117
- data/lib/engineyard/collection.rb +0 -7
- data/lib/engineyard/collection/abstract.rb +0 -71
- data/lib/engineyard/collection/apps.rb +0 -8
- data/lib/engineyard/collection/environments.rb +0 -8
- data/lib/engineyard/model.rb +0 -12
- data/lib/engineyard/model/account.rb +0 -8
- data/lib/engineyard/model/api_struct.rb +0 -33
- data/lib/engineyard/model/app.rb +0 -32
- data/lib/engineyard/model/deployment.rb +0 -90
- data/lib/engineyard/model/environment.rb +0 -194
- data/lib/engineyard/model/instance.rb +0 -166
- data/lib/engineyard/model/log.rb +0 -9
- data/lib/engineyard/model/user.rb +0 -6
- data/lib/engineyard/resolver.rb +0 -134
- data/lib/engineyard/rest_client_ext.rb +0 -9
- data/lib/engineyard/ruby_ext.rb +0 -9
- data/spec/engineyard/api_spec.rb +0 -39
- data/spec/engineyard/collection/apps_spec.rb +0 -16
- data/spec/engineyard/collection/environments_spec.rb +0 -16
- data/spec/engineyard/model/api_struct_spec.rb +0 -41
- data/spec/engineyard/model/environment_spec.rb +0 -198
- data/spec/engineyard/model/instance_spec.rb +0 -27
- data/spec/engineyard/resolver_spec.rb +0 -112
- data/spec/support/fake_awsm.ru +0 -245
- data/spec/support/scenarios.rb +0 -417
@@ -1,60 +1,83 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe EY::Repo do
|
4
|
+
let(:path) { p = Pathname.new(Dir.tmpdir).join('ey-test'); p.mkpath; p }
|
5
|
+
|
4
6
|
before(:each) do
|
5
|
-
|
6
|
-
|
7
|
-
@r = EY::Repo.new("/tmp/ey-test")
|
7
|
+
Dir.chdir(path) { `git init -q` }
|
8
|
+
ENV['GIT_DIR'] = path.join('.git').to_s
|
8
9
|
end
|
9
10
|
|
10
11
|
after(:each) do
|
11
|
-
|
12
|
+
path.rmtree
|
13
|
+
ENV.delete('GIT_DIR')
|
12
14
|
end
|
13
15
|
|
14
16
|
def set_head(head)
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
def config_path
|
19
|
-
@path.join("config")
|
17
|
+
path.join('.git','HEAD').open('w') {|f| f.write(head) }
|
20
18
|
end
|
21
19
|
|
22
20
|
def set_url(url, remote)
|
23
|
-
|
24
|
-
system("git config -f #{config_path} remote.#{remote}.url #{url}")
|
21
|
+
`git remote add #{remote} #{url}`
|
25
22
|
end
|
26
23
|
|
27
|
-
|
28
|
-
|
24
|
+
describe ".new" do
|
25
|
+
it "creates a working repo object in a repo" do
|
26
|
+
EY::Repo.new.remotes.should be_empty
|
27
|
+
end
|
28
|
+
|
29
|
+
it "doesn't raise if created outside a repository until trying to do something" do
|
30
|
+
ENV['GIT_DIR'] = nil
|
31
|
+
Dir.chdir('/tmp') do
|
32
|
+
repo = EY::Repo.new
|
33
|
+
lambda { repo.remotes }.should raise_error(EY::Repo::NotAGitRepository)
|
34
|
+
end
|
35
|
+
end
|
29
36
|
end
|
30
37
|
|
31
|
-
describe "
|
32
|
-
it "
|
33
|
-
|
34
|
-
@r.current_branch.should == "master"
|
38
|
+
describe ".exist?" do
|
39
|
+
it "is true when env vars are set to a repo" do
|
40
|
+
EY::Repo.should be_exist
|
35
41
|
end
|
36
42
|
|
37
|
-
it "
|
38
|
-
|
39
|
-
|
43
|
+
it "is true when pwd is a repo" do
|
44
|
+
Dir.chdir(File.dirname(ENV['GIT_DIR'])) do
|
45
|
+
ENV['GIT_DIR'] = nil
|
46
|
+
EY::Repo.should be_exist
|
47
|
+
end
|
40
48
|
end
|
41
|
-
end # current_branch
|
42
49
|
|
43
|
-
|
44
|
-
|
45
|
-
|
50
|
+
it "is false when outside of any repo" do
|
51
|
+
ENV['GIT_DIR'] = nil
|
52
|
+
Dir.chdir('/tmp') do
|
53
|
+
EY::Repo.should_not be_exist
|
54
|
+
end
|
46
55
|
end
|
47
56
|
end
|
48
57
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
58
|
+
context "in a repository dir" do
|
59
|
+
|
60
|
+
before(:each) do
|
61
|
+
@repo = EY::Repo.new
|
62
|
+
end
|
63
|
+
|
64
|
+
describe "current_branch method" do
|
65
|
+
it "returns the name of the current branch" do
|
66
|
+
set_head "ref: refs/heads/master"
|
67
|
+
@repo.current_branch.should == "master"
|
68
|
+
end
|
69
|
+
|
70
|
+
it "returns nil if there is no current branch" do
|
71
|
+
set_head "20bf478ab6a91ec5771130aa4c8cfd3d150c4146"
|
72
|
+
@repo.current_branch.should be_nil
|
73
|
+
end
|
74
|
+
end # current_branch
|
75
|
+
|
76
|
+
describe "#fail_on_no_remotes!" do
|
77
|
+
it "raises when there are no remotes" do
|
78
|
+
lambda { @repo.fail_on_no_remotes! }.should raise_error(EY::Repo::NoRemotesError)
|
79
|
+
end
|
57
80
|
end
|
58
|
-
end # url
|
59
81
|
|
60
|
-
end
|
82
|
+
end
|
83
|
+
end
|
data/spec/ey/deploy_spec.rb
CHANGED
@@ -1,23 +1,22 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe "ey deploy without an eyrc file" do
|
4
|
+
given "integration"
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
before(:each) do
|
6
|
+
it "prompts for authentication before continuing" do
|
8
7
|
api_scenario "one app, one environment"
|
9
|
-
end
|
10
8
|
|
11
|
-
|
12
|
-
|
13
|
-
input.puts(
|
14
|
-
input.puts("test")
|
9
|
+
ey(%w[deploy --no-migrate], :hide_err => true) do |input|
|
10
|
+
input.puts(scenario_email)
|
11
|
+
input.puts(scenario_password)
|
15
12
|
end
|
16
13
|
|
17
14
|
@out.should include("We need to fetch your API token; please log in.")
|
18
15
|
@out.should include("Email:")
|
19
16
|
@out.should include("Password:")
|
20
17
|
@ssh_commands.should_not be_empty
|
18
|
+
|
19
|
+
read_eyrc.should == {"api_token" => scenario_api_token}
|
21
20
|
end
|
22
21
|
end
|
23
22
|
|
@@ -31,12 +30,17 @@ describe "ey deploy" do
|
|
31
30
|
cmd << "--app" << opts[:app] if opts[:app]
|
32
31
|
cmd << "--account" << opts[:account] if opts[:account]
|
33
32
|
cmd << "--ref" << opts[:ref] if opts[:ref]
|
33
|
+
cmd << "--migrate" if opts[:migrate]
|
34
|
+
cmd << opts[:migrate] if opts[:migrate].respond_to?(:str)
|
35
|
+
cmd << "--no-migrate" if opts[:migrate] == nil
|
34
36
|
cmd << "--verbose" if opts[:verbose]
|
35
37
|
cmd
|
36
38
|
end
|
37
39
|
|
38
40
|
def verify_ran(scenario)
|
39
|
-
@out.should match(/Beginning deploy
|
41
|
+
@out.should match(/Beginning deploy.../)
|
42
|
+
@out.should match(/Application:\s+#{scenario[:application]}/)
|
43
|
+
@out.should match(/Environment:\s+#{scenario[:environment]}/)
|
40
44
|
@out.should match(/deployment recorded/i)
|
41
45
|
@ssh_commands.should have_command_like(/engineyard-serverside.*deploy.*--app #{scenario[:application]}/)
|
42
46
|
end
|
@@ -51,7 +55,7 @@ describe "ey deploy" do
|
|
51
55
|
|
52
56
|
context "without ssh keys (with ssh enabled)" do
|
53
57
|
before do
|
54
|
-
ENV
|
58
|
+
ENV.delete('NO_SSH')
|
55
59
|
Net::SSH.stub!(:start).and_raise(Net::SSH::AuthenticationFailed.new("no key"))
|
56
60
|
end
|
57
61
|
|
@@ -60,34 +64,34 @@ describe "ey deploy" do
|
|
60
64
|
end
|
61
65
|
|
62
66
|
it "tells you that you need to add an appropriate ssh key" do
|
63
|
-
|
64
|
-
fast_failing_ey [
|
67
|
+
login_scenario "one app, one environment"
|
68
|
+
fast_failing_ey %w[deploy --no-migrate]
|
65
69
|
@err.should include("Authentication Failed")
|
66
70
|
end
|
67
71
|
end
|
68
72
|
|
69
73
|
context "with invalid input" do
|
70
74
|
it "complains when there is no app" do
|
71
|
-
|
75
|
+
login_scenario "empty"
|
72
76
|
fast_failing_ey ["deploy"]
|
73
|
-
@err.should include(%|
|
77
|
+
@err.should include(%|No application found|)
|
74
78
|
end
|
75
79
|
|
76
80
|
it "complains when the specified environment does not contain the app" do
|
77
|
-
|
81
|
+
login_scenario "one app, one environment, not linked"
|
78
82
|
fast_failing_ey %w[deploy -e giblets -r master]
|
79
|
-
@err.should match(/
|
83
|
+
@err.should match(/Application "rails232app" and environment "giblets" are not associated./)
|
80
84
|
end
|
81
85
|
|
82
86
|
it "complains when environment is not specified and app is in >1 environment" do
|
83
|
-
|
84
|
-
fast_failing_ey %w[deploy]
|
85
|
-
@err.should match(/
|
87
|
+
login_scenario "one app, many environments"
|
88
|
+
fast_failing_ey %w[deploy --ref master --no-migrate]
|
89
|
+
@err.should match(/Multiple application environments possible/i)
|
86
90
|
end
|
87
91
|
|
88
92
|
it "complains when the app master is in a non-running state" do
|
89
|
-
|
90
|
-
fast_failing_ey %w[deploy --environment giblets --ref master]
|
93
|
+
login_scenario "one app, one environment, app master red"
|
94
|
+
fast_failing_ey %w[deploy --environment giblets --ref master --no-migrate]
|
91
95
|
@err.should_not match(/No running instances/i)
|
92
96
|
@err.should match(/running.*\(green\)/)
|
93
97
|
end
|
@@ -95,18 +99,52 @@ describe "ey deploy" do
|
|
95
99
|
|
96
100
|
context "migration command" do
|
97
101
|
before(:each) do
|
98
|
-
|
102
|
+
login_scenario "one app, one environment"
|
99
103
|
end
|
100
104
|
|
101
105
|
it "finds engineyard-serverside despite its being buried in the filesystem" do
|
102
|
-
fast_ey %w[deploy]
|
106
|
+
fast_ey %w[deploy --no-migrate]
|
103
107
|
@ssh_commands.last.should =~ %r{/usr/local/ey_resin/ruby/bin/engineyard-serverside}
|
104
108
|
end
|
105
109
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
+
context "without migrate sepecified interactively reads migration command" do
|
111
|
+
after { File.unlink 'config/ey.yml' }
|
112
|
+
|
113
|
+
it "defaults to yes, and then rake db:migrate" do
|
114
|
+
File.exist?('config/ey.yml').should be_false
|
115
|
+
ey(%w[deploy]) do |input|
|
116
|
+
input.puts('')
|
117
|
+
input.puts('')
|
118
|
+
end
|
119
|
+
@ssh_commands.last.should =~ /engineyard-serverside.*deploy/
|
120
|
+
@ssh_commands.last.should =~ /--migrate 'rake db:migrate'/
|
121
|
+
env_conf = read_yaml('config/ey.yml')['environments']['giblets']
|
122
|
+
env_conf['migrate'].should == true
|
123
|
+
env_conf['migration_command'].should == 'rake db:migrate'
|
124
|
+
end
|
125
|
+
|
126
|
+
it "accepts new commands" do
|
127
|
+
File.exist?('config/ey.yml').should be_false
|
128
|
+
ey(%w[deploy], :hide_err => true) do |input|
|
129
|
+
input.puts("y")
|
130
|
+
input.puts("ruby migrate")
|
131
|
+
end
|
132
|
+
@ssh_commands.last.should =~ /engineyard-serverside.*deploy/
|
133
|
+
@ssh_commands.last.should =~ /--migrate 'ruby migrate'/
|
134
|
+
env_conf = read_yaml('config/ey.yml')['environments']['giblets']
|
135
|
+
env_conf['migrate'].should == true
|
136
|
+
env_conf['migration_command'].should == 'ruby migrate'
|
137
|
+
end
|
138
|
+
|
139
|
+
it "doesn't ask for the command if you say no" do
|
140
|
+
File.exist?('config/ey.yml').should be_false
|
141
|
+
ey(%w[deploy], :hide_err => true) do |input|
|
142
|
+
input.puts("no")
|
143
|
+
end
|
144
|
+
@ssh_commands.last.should =~ /engineyard-serverside.*deploy/
|
145
|
+
@ssh_commands.last.should_not =~ /--migrate/
|
146
|
+
read_yaml('config/ey.yml')['environments']['giblets']['migrate'].should == false
|
147
|
+
end
|
110
148
|
end
|
111
149
|
|
112
150
|
it "can be disabled with --no-migrate" do
|
@@ -124,9 +162,10 @@ describe "ey deploy" do
|
|
124
162
|
before { write_yaml({"environments" => {"giblets" => { "migration_command" => 'thor fancy:migrate' }}}, 'ey.yml') }
|
125
163
|
after { File.unlink 'ey.yml' }
|
126
164
|
|
127
|
-
it "migrates with the custom command by default" do
|
165
|
+
it "migrates with the custom command by default (and fixes ey.yml to reflect the previous default behavior)" do
|
128
166
|
fast_ey %w[deploy]
|
129
167
|
@ssh_commands.last.should =~ /--migrate 'thor fancy:migrate'/
|
168
|
+
read_yaml('ey.yml')['environments']['giblets']['migrate'].should == true
|
130
169
|
end
|
131
170
|
end
|
132
171
|
|
@@ -155,9 +194,10 @@ describe "ey deploy" do
|
|
155
194
|
before { write_yaml({"environments" => {"giblets" => {"migrate" => true}}}, 'ey.yml') }
|
156
195
|
after { File.unlink 'ey.yml' }
|
157
196
|
|
158
|
-
it "migrates with the default" do
|
197
|
+
it "migrates with the default (and writes the default to ey.yml)" do
|
159
198
|
fast_ey %w[deploy]
|
160
199
|
@ssh_commands.last.should match(/--migrate 'rake db:migrate'/)
|
200
|
+
read_yaml('ey.yml')['environments']['giblets']['migration_command'].should == 'rake db:migrate'
|
161
201
|
end
|
162
202
|
end
|
163
203
|
|
@@ -179,11 +219,11 @@ describe "ey deploy" do
|
|
179
219
|
|
180
220
|
context "the --framework-env option" do
|
181
221
|
before(:each) do
|
182
|
-
|
222
|
+
login_scenario "one app, one environment"
|
183
223
|
end
|
184
224
|
|
185
225
|
it "passes the framework environment" do
|
186
|
-
fast_ey %w[deploy]
|
226
|
+
fast_ey %w[deploy --no-migrate]
|
187
227
|
@ssh_commands.last.should match(/--framework-env production/)
|
188
228
|
end
|
189
229
|
end
|
@@ -205,32 +245,32 @@ describe "ey deploy" do
|
|
205
245
|
use_git_repo('deploy test')
|
206
246
|
|
207
247
|
before(:all) do
|
208
|
-
|
248
|
+
login_scenario "one app, one environment"
|
209
249
|
end
|
210
250
|
|
211
251
|
context "without a configured default branch" do
|
212
252
|
it "defaults to the checked-out local branch" do
|
213
|
-
fast_ey %w[deploy]
|
253
|
+
fast_ey %w[deploy --no-migrate]
|
214
254
|
@ssh_commands.last.should =~ /--ref resolved-current-branch/
|
215
255
|
end
|
216
256
|
|
217
257
|
it "deploys another branch if given" do
|
218
|
-
fast_ey %w[deploy --ref master]
|
258
|
+
fast_ey %w[deploy --ref master --no-migrate]
|
219
259
|
@ssh_commands.last.should =~ /--ref resolved-master/
|
220
260
|
end
|
221
261
|
|
222
262
|
it "deploys a tag if given" do
|
223
|
-
fast_ey %w[deploy --ref v1]
|
263
|
+
fast_ey %w[deploy --ref v1 --no-migrate]
|
224
264
|
@ssh_commands.last.should =~ /--ref resolved-v1/
|
225
265
|
end
|
226
266
|
|
227
267
|
it "allows using --branch to specify a branch" do
|
228
|
-
fast_ey %w[deploy --branch master]
|
268
|
+
fast_ey %w[deploy --branch master --no-migrate]
|
229
269
|
@ssh_commands.last.should match(/--ref resolved-master/)
|
230
270
|
end
|
231
271
|
|
232
272
|
it "allows using --tag to specify the tag" do
|
233
|
-
fast_ey %w[deploy --tag v1]
|
273
|
+
fast_ey %w[deploy --tag v1 --no-migrate]
|
234
274
|
@ssh_commands.last.should match(/--ref resolved-v1/)
|
235
275
|
end
|
236
276
|
end
|
@@ -245,14 +285,14 @@ describe "ey deploy" do
|
|
245
285
|
end
|
246
286
|
|
247
287
|
it "gets passed along to engineyard-serverside" do
|
248
|
-
fast_ey %w[deploy]
|
288
|
+
fast_ey %w[deploy --no-migrate]
|
249
289
|
@ssh_commands.last.should =~ /--config '{.*"bert":"ernie".*}'/
|
250
290
|
end
|
251
291
|
end
|
252
292
|
|
253
293
|
context "with a configured default branch" do
|
254
294
|
before(:each) do
|
255
|
-
write_yaml({"environments" => {"giblets" => {"branch" => "master"}}}, 'ey.yml')
|
295
|
+
write_yaml({"environments" => {"giblets" => {"branch" => "master", "migrate" => false}}}, 'ey.yml')
|
256
296
|
end
|
257
297
|
|
258
298
|
after(:each) do
|
@@ -266,7 +306,7 @@ describe "ey deploy" do
|
|
266
306
|
|
267
307
|
it "complains about a non-default branch without --ignore-default-branch" do
|
268
308
|
fast_failing_ey %w[deploy -r current-branch]
|
269
|
-
@err.should =~ /
|
309
|
+
@err.should =~ /default branch is set to "master"/
|
270
310
|
end
|
271
311
|
|
272
312
|
it "deploys a non-default branch with --ignore-default-branch" do
|
@@ -283,18 +323,20 @@ describe "ey deploy" do
|
|
283
323
|
|
284
324
|
context "specifying an environment" do
|
285
325
|
before(:all) do
|
286
|
-
|
326
|
+
login_scenario "one app, many similarly-named environments"
|
287
327
|
end
|
288
328
|
|
289
329
|
it "lets you choose by complete name even if the complete name is ambiguous" do
|
290
|
-
fast_ey %w[deploy --environment railsapp_staging]
|
291
|
-
@out.should match(/Beginning deploy
|
330
|
+
fast_ey %w[deploy --environment railsapp_staging --no-migrate]
|
331
|
+
@out.should match(/Beginning deploy.../)
|
332
|
+
@out.should match(/Ref:\s+master/)
|
333
|
+
@out.should match(/Environment:\s+railsapp_staging/)
|
292
334
|
end
|
293
335
|
end
|
294
336
|
|
295
337
|
context "--extra-deploy-hook-options" do
|
296
338
|
before(:all) do
|
297
|
-
|
339
|
+
login_scenario "one app, one environment"
|
298
340
|
end
|
299
341
|
|
300
342
|
def extra_deploy_hook_options
|
@@ -306,7 +348,7 @@ describe "ey deploy" do
|
|
306
348
|
end
|
307
349
|
|
308
350
|
it "passes the extra configuration to engineyard-serverside" do
|
309
|
-
ey %w[deploy --extra-deploy-hook-options some:stuff more:crap]
|
351
|
+
ey %w[deploy --extra-deploy-hook-options some:stuff more:crap --no-migrate]
|
310
352
|
extra_deploy_hook_options.should_not be_nil
|
311
353
|
extra_deploy_hook_options['some'].should == 'stuff'
|
312
354
|
extra_deploy_hook_options['more'].should == 'crap'
|
@@ -314,7 +356,7 @@ describe "ey deploy" do
|
|
314
356
|
|
315
357
|
context "when ey.yml is present" do
|
316
358
|
before do
|
317
|
-
write_yaml({"environments" => {"giblets" => {"beer" => "stout"}}}, 'ey.yml')
|
359
|
+
write_yaml({"environments" => {"giblets" => {"beer" => "stout", "migrate" => true}}}, 'ey.yml')
|
318
360
|
end
|
319
361
|
|
320
362
|
after { File.unlink("ey.yml") }
|
@@ -328,7 +370,7 @@ describe "ey deploy" do
|
|
328
370
|
|
329
371
|
context "specifying the application" do
|
330
372
|
before(:all) do
|
331
|
-
|
373
|
+
login_scenario "one app, one environment"
|
332
374
|
end
|
333
375
|
|
334
376
|
before(:each) do
|
@@ -341,15 +383,23 @@ describe "ey deploy" do
|
|
341
383
|
end
|
342
384
|
|
343
385
|
it "allows you to specify an app when not in a directory" do
|
344
|
-
fast_ey %w[deploy --app rails232app --ref master]
|
386
|
+
fast_ey %w[deploy --app rails232app --ref master --migrate]
|
345
387
|
@ssh_commands.last.should match(/--app rails232app/)
|
346
388
|
@ssh_commands.last.should match(/--ref resolved-master/)
|
389
|
+
@ssh_commands.last.should match(/--migrate 'rake db:migrate'/)
|
347
390
|
end
|
348
391
|
|
349
392
|
it "requires that you specify a ref when specifying the application" do
|
350
393
|
Dir.chdir(File.expand_path("~")) do
|
351
|
-
fast_failing_ey %w[deploy --app rails232app]
|
352
|
-
@err.should match(/you must also specify the ref
|
394
|
+
fast_failing_ey %w[deploy --app rails232app --no-migrate]
|
395
|
+
@err.should match(/you must also specify the --ref/)
|
396
|
+
end
|
397
|
+
end
|
398
|
+
|
399
|
+
it "requires that you specify a migrate option when specifying the application" do
|
400
|
+
Dir.chdir(File.expand_path("~")) do
|
401
|
+
fast_failing_ey %w[deploy --app rails232app --ref master]
|
402
|
+
@err.should match(/you must also specify .* --migrate or --no-migrate/)
|
353
403
|
end
|
354
404
|
end
|
355
405
|
end
|
@@ -358,8 +408,8 @@ describe "ey deploy" do
|
|
358
408
|
use_git_repo("deploy test")
|
359
409
|
|
360
410
|
before(:all) do
|
361
|
-
|
362
|
-
fast_ey [
|
411
|
+
login_scenario "one app, one environment"
|
412
|
+
fast_ey %w[deploy --no-migrate]
|
363
413
|
@deploy_command = @ssh_commands.find {|c| c =~ /engineyard-serverside.*deploy/ }
|
364
414
|
end
|
365
415
|
|