engineyard 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/engineyard/api.rb +5 -1
- data/lib/engineyard/cli.rb +1 -1
- data/lib/engineyard/cli/recipes.rb +3 -3
- data/lib/engineyard/collection/abstract.rb +9 -1
- data/lib/engineyard/error.rb +27 -6
- data/lib/engineyard/model/#api_struct.rb# +31 -0
- data/lib/engineyard/model/api_struct.rb +1 -0
- data/lib/engineyard/thor.rb +11 -1
- data/lib/engineyard/version.rb +1 -1
- data/spec/engineyard/#resolver_spec.rb# +41 -0
- data/spec/engineyard/api_spec.rb +30 -0
- data/spec/engineyard/collection/apps_spec.rb +2 -0
- data/spec/engineyard/collection/environments_spec.rb +2 -0
- data/spec/ey/list_environments_spec.rb +6 -0
- data/spec/ey/recipes/apply_spec.rb +6 -0
- data/spec/ey/recipes/download_spec.rb +6 -0
- data/spec/ey/recipes/upload_spec.rb +6 -0
- data/spec/ey/ssh_spec.rb +6 -0
- data/spec/spec_helper.rb +2 -6
- data/spec/support/#shared_behavior.rb# +275 -0
- data/spec/support/bundled_ey +4 -7
- data/spec/support/fake_awsm.ru +197 -313
- data/spec/support/git_repo.rb +0 -1
- data/spec/support/helpers.rb +1 -2
- data/spec/support/shared_behavior.rb +28 -1
- metadata +48 -43
data/spec/support/bundled_ey
CHANGED
@@ -1,10 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
ENV['BUNDLE_GEMFILE'] = File.expand_path('../../../Gemfile', __FILE__)
|
6
|
-
require "rubygems"; require "bundler"; Bundler.setup
|
7
|
-
end
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler/setup'
|
8
5
|
|
9
6
|
$LOAD_PATH.unshift File.expand_path("../../../lib", __FILE__)
|
10
|
-
load File.expand_path('../../../bin/ey', __FILE__)
|
7
|
+
load File.expand_path('../../../bin/ey', __FILE__)
|
data/spec/support/fake_awsm.ru
CHANGED
@@ -10,7 +10,7 @@ class FakeAwsm < Sinatra::Base
|
|
10
10
|
# every request. It makes sense; you hardly ever want to keep
|
11
11
|
# state in your application object (accidentally or otherwise),
|
12
12
|
# but in this situation that's exactly what we want to do.
|
13
|
-
@@
|
13
|
+
@@cloud_mock = Scenario::Base # have to start somewhere
|
14
14
|
end
|
15
15
|
|
16
16
|
before { content_type "application/json" }
|
@@ -23,7 +23,7 @@ class FakeAwsm < Sinatra::Base
|
|
23
23
|
put "/scenario" do
|
24
24
|
new_scenario = case params[:scenario]
|
25
25
|
when "empty"
|
26
|
-
Scenario::
|
26
|
+
Scenario::Base
|
27
27
|
when "one app, one environment, not linked"
|
28
28
|
Scenario::UnlinkedApp
|
29
29
|
when "two apps"
|
@@ -38,24 +38,26 @@ class FakeAwsm < Sinatra::Base
|
|
38
38
|
Scenario::OneAppManyEnvs
|
39
39
|
when "one app, many similarly-named environments"
|
40
40
|
Scenario::OneAppManySimilarlyNamedEnvs
|
41
|
+
when "two apps, same git uri"
|
42
|
+
Scenario::TwoAppsSameGitUri
|
41
43
|
else
|
42
44
|
status(400)
|
43
45
|
return {"ok" => "false", "message" => "wtf is the #{params[:scenario]} scenario?"}.to_json
|
44
46
|
end
|
45
|
-
@@
|
47
|
+
@@cloud_mock = CloudMock.new(new_scenario.new(params[:remote]))
|
46
48
|
{"ok" => "true"}.to_json
|
47
49
|
end
|
48
50
|
|
49
51
|
get "/api/v2/apps" do
|
50
|
-
{"apps" => @@
|
52
|
+
{"apps" => @@cloud_mock.apps}.to_json
|
51
53
|
end
|
52
54
|
|
53
55
|
get "/api/v2/environments" do
|
54
|
-
{"environments" => @@
|
56
|
+
{"environments" => @@cloud_mock.environments}.to_json
|
55
57
|
end
|
56
58
|
|
57
59
|
get "/api/v2/environments/:env_id/logs" do
|
58
|
-
{"logs" => @@
|
60
|
+
{"logs" => @@cloud_mock.logs(params[:env_id].to_i)}.to_json
|
59
61
|
end
|
60
62
|
|
61
63
|
get "/api/v2/environments/:env_id/recipes" do
|
@@ -118,56 +120,106 @@ private
|
|
118
120
|
params[:password] == "test"
|
119
121
|
end
|
120
122
|
|
121
|
-
|
122
|
-
|
123
|
-
|
123
|
+
class CloudMock
|
124
|
+
def initialize(initial_conditions)
|
125
|
+
@apps, @envs, @keys, @app_joins, @key_joins = [], [], [], [], []
|
126
|
+
@next_id = 1
|
124
127
|
|
125
|
-
|
126
|
-
|
128
|
+
initial_conditions.starting_apps.each {|a| add_app(a) }
|
129
|
+
initial_conditions.starting_environments.each {|e| add_environment(e) }
|
130
|
+
initial_conditions.starting_app_joins.each {|(app_id, env_id)| link_app(app_id, env_id) }
|
131
|
+
end
|
132
|
+
|
133
|
+
def add_app(app)
|
134
|
+
app["id"] ||= next_id
|
135
|
+
@apps << app
|
136
|
+
app
|
137
|
+
end
|
138
|
+
|
139
|
+
def add_environment(env)
|
140
|
+
env["id"] ||= next_id
|
141
|
+
|
142
|
+
unless env.has_key?("app_master")
|
143
|
+
master = env["instances"].find{ |i| %w[solo app_master].include?(i["role"]) }
|
144
|
+
env.merge!("app_master" => master)
|
127
145
|
end
|
128
146
|
|
129
|
-
|
130
|
-
|
147
|
+
@envs << env
|
148
|
+
env
|
149
|
+
end
|
150
|
+
|
151
|
+
def link_app(app_id, env_id)
|
152
|
+
@apps.find {|a| a["id"] == app_id } or raise "No such app id:#{app_id}"
|
153
|
+
@envs.find {|e| e["id"] == env_id } or raise "No such environment id:#{env_id}"
|
154
|
+
@app_joins << [app_id, env_id]
|
155
|
+
@app_joins.uniq!
|
156
|
+
end
|
157
|
+
|
158
|
+
def apps
|
159
|
+
@apps.dup.map do |app|
|
160
|
+
app.merge("environments" => joined_envs(app))
|
131
161
|
end
|
162
|
+
end
|
132
163
|
|
133
|
-
|
134
|
-
|
164
|
+
def logs(env_id)
|
165
|
+
[{
|
166
|
+
"id" => env_id,
|
167
|
+
"role" => "app_master",
|
168
|
+
"main" => "MAIN LOG OUTPUT",
|
169
|
+
"custom" => "CUSTOM LOG OUTPUT"
|
170
|
+
}]
|
171
|
+
end
|
172
|
+
|
173
|
+
def environments
|
174
|
+
@envs.dup.map do |env|
|
175
|
+
env.merge("apps" => joined_apps(env))
|
135
176
|
end
|
136
|
-
end
|
177
|
+
end
|
137
178
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
179
|
+
private
|
180
|
+
|
181
|
+
def next_id
|
182
|
+
id = @next_id
|
183
|
+
@next_id += 1
|
184
|
+
id
|
185
|
+
end
|
186
|
+
|
187
|
+
def joined_envs(app)
|
188
|
+
related_objects(app, @envs, @app_joins)
|
189
|
+
end
|
190
|
+
|
191
|
+
def joined_apps(env)
|
192
|
+
related_objects(env, @apps, @app_joins.map {|j| j.reverse})
|
193
|
+
end
|
194
|
+
|
195
|
+
def related_objects(obj, candidates, relation)
|
196
|
+
candidate_table = candidates.inject({}) do |table, candidate|
|
197
|
+
table.merge(candidate["id"] => candidate)
|
144
198
|
end
|
145
199
|
|
146
|
-
|
147
|
-
[
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
"framework_env" => "production",
|
161
|
-
"app_master" => {
|
162
|
-
"status" => "running",
|
163
|
-
"id" => 27220,
|
164
|
-
"amazon_id" => 'i-ddbbdd92',
|
165
|
-
"role" => "solo",
|
166
|
-
"public_hostname" => "app_master_hostname.compute-1.amazonaws.com"}}]
|
200
|
+
relation.find_all do |(obj_id, candidate_id)|
|
201
|
+
obj["id"] == obj_id
|
202
|
+
end.map do |(obj_id, candidate_id)|
|
203
|
+
candidate_table[candidate_id]
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
module Scenario
|
209
|
+
class Base
|
210
|
+
attr_accessor :git_remote
|
211
|
+
|
212
|
+
def initialize(git_remote)
|
213
|
+
self.git_remote = git_remote
|
167
214
|
end
|
168
|
-
end # UnlinkedApp
|
169
215
|
|
170
|
-
|
216
|
+
def starting_apps() [] end
|
217
|
+
def starting_environments() [] end
|
218
|
+
def starting_app_joins() [] end
|
219
|
+
|
220
|
+
end
|
221
|
+
|
222
|
+
class LinkedApp < Base
|
171
223
|
def _instances
|
172
224
|
[{
|
173
225
|
"id" => 27220,
|
@@ -222,140 +274,103 @@ private
|
|
222
274
|
end
|
223
275
|
private :_instances
|
224
276
|
|
225
|
-
def
|
226
|
-
[{
|
227
|
-
"
|
228
|
-
|
229
|
-
"name" => "giblets",
|
230
|
-
"apps" => [{"name" => "rails232app",
|
231
|
-
"repository_uri" => git_remote}],
|
232
|
-
"instances_count" => 1,
|
233
|
-
"stack_name" => "nginx_mongrel",
|
234
|
-
"id" => 200,
|
235
|
-
"framework_env" => "production",
|
236
|
-
"app_master" => _instances.first}],
|
277
|
+
def starting_apps
|
278
|
+
[{
|
279
|
+
"id" => 1001,
|
280
|
+
"name" => "rails232app",
|
237
281
|
"repository_uri" => git_remote}]
|
238
282
|
end
|
239
283
|
|
240
|
-
def
|
284
|
+
def starting_environments
|
241
285
|
[{
|
286
|
+
"id" => 200,
|
242
287
|
"ssh_username" => "turkey",
|
243
288
|
"instances" => _instances,
|
244
289
|
"name" => "giblets",
|
245
|
-
"
|
246
|
-
|
247
|
-
|
290
|
+
"instances_count" => 4,
|
291
|
+
"stack_name" => "nginx_mongrel",
|
292
|
+
"framework_env" => "production"}]
|
293
|
+
end
|
294
|
+
|
295
|
+
def starting_app_joins
|
296
|
+
[[1001, 200]]
|
297
|
+
end
|
298
|
+
|
299
|
+
end # LinkedApp
|
300
|
+
|
301
|
+
class UnlinkedApp < Base
|
302
|
+
def starting_apps
|
303
|
+
[{
|
304
|
+
"id" => 1001,
|
305
|
+
"name" => "rails232app",
|
306
|
+
"repository_uri" => git_remote}]
|
307
|
+
end
|
308
|
+
|
309
|
+
def starting_environments
|
310
|
+
[{
|
311
|
+
"ssh_username" => "turkey",
|
312
|
+
"instances" => [{
|
313
|
+
"status" => "running",
|
314
|
+
"id" => 27220,
|
315
|
+
"amazon_id" => 'i-ddbbdd92',
|
316
|
+
"role" => "solo",
|
317
|
+
"public_hostname" => "ec2-174-129-198-124.compute-1.amazonaws.com"}],
|
318
|
+
"name" => "giblets",
|
248
319
|
"instances_count" => 1,
|
249
320
|
"stack_name" => "nginx_mongrel",
|
250
321
|
"id" => 200,
|
251
|
-
"framework_env" => "production"
|
252
|
-
"app_master" => _instances[0]}]
|
322
|
+
"framework_env" => "production"}]
|
253
323
|
end
|
324
|
+
end # UnlinkedApp
|
254
325
|
|
255
|
-
|
326
|
+
class LinkedAppNotRunning < Base
|
327
|
+
def starting_apps
|
256
328
|
[{
|
257
|
-
|
258
|
-
|
259
|
-
"main" => "MAIN LOG OUTPUT",
|
260
|
-
"custom" => "CUSTOM LOG OUTPUT"
|
261
|
-
}]
|
262
|
-
end
|
263
|
-
end # LinkedApp
|
264
|
-
|
265
|
-
class LinkedAppNotRunning < Empty
|
266
|
-
def apps
|
267
|
-
[{"name" => "rails232app",
|
268
|
-
"environments" => [{"ssh_username" => "turkey",
|
269
|
-
"instances" => [],
|
270
|
-
"name" => "giblets",
|
271
|
-
"apps" => [{"name" => "rails232app",
|
272
|
-
"repository_uri" => git_remote}],
|
273
|
-
"instances_count" => 0,
|
274
|
-
"stack_name" => "nginx_mongrel",
|
275
|
-
"id" => 200,
|
276
|
-
"framework_env" => "production",
|
277
|
-
"app_master" => {}}],
|
329
|
+
"id" => 1001,
|
330
|
+
"name" => "rails232app",
|
278
331
|
"repository_uri" => git_remote}]
|
279
332
|
end
|
280
333
|
|
281
|
-
def
|
334
|
+
def starting_environments
|
282
335
|
[{
|
283
336
|
"ssh_username" => "turkey",
|
284
337
|
"instances" => [],
|
285
338
|
"name" => "giblets",
|
286
|
-
"apps" => [{
|
287
|
-
"name" => "rails232app",
|
288
|
-
"repository_uri" => git_remote}],
|
289
339
|
"instances_count" => 0,
|
290
340
|
"stack_name" => "nginx_mongrel",
|
291
341
|
"id" => 200,
|
292
|
-
|
293
|
-
"app_master" => {}}]
|
342
|
+
"framework_env" => "production"}]
|
294
343
|
end
|
295
344
|
|
296
|
-
def
|
297
|
-
[]
|
345
|
+
def starting_app_joins
|
346
|
+
[[1001, 200]]
|
298
347
|
end
|
299
348
|
end # LinkedAppNotRunning
|
300
349
|
|
301
350
|
class LinkedAppRedMaster < LinkedApp
|
302
|
-
def
|
303
|
-
apps = super
|
304
|
-
apps[0]["environments"][0]["instances"][0]["status"] = "error"
|
305
|
-
apps[0]["environments"][0]["app_master"]["status"] = "error"
|
306
|
-
apps
|
307
|
-
end
|
308
|
-
|
309
|
-
def environments
|
351
|
+
def starting_environments
|
310
352
|
envs = super
|
311
353
|
envs[0]["instances"][0]["status"] = "error"
|
312
|
-
envs[0]["app_master"]["status"] = "error"
|
313
354
|
envs
|
314
355
|
end
|
315
356
|
end
|
316
357
|
|
317
|
-
class OneAppManyEnvs <
|
318
|
-
def
|
319
|
-
|
358
|
+
class OneAppManyEnvs < Base
|
359
|
+
def starting_apps
|
360
|
+
[{
|
361
|
+
"id" => 1001,
|
320
362
|
"name" => "rails232app",
|
321
|
-
"repository_uri" => git_remote
|
322
|
-
}]
|
323
|
-
|
324
|
-
[{"name" => "rails232app",
|
325
|
-
"environments" => [{
|
326
|
-
"ssh_username" => "turkey",
|
327
|
-
"instances" => [{
|
328
|
-
"status" => "running",
|
329
|
-
"id" => 27220,
|
330
|
-
"amazon_id" => 'i-ddbbdd92',
|
331
|
-
"role" => "solo",
|
332
|
-
"public_hostname" => "app_master_hostname.compute-1.amazonaws.com"}],
|
333
|
-
"name" => "giblets",
|
334
|
-
"apps" => apps,
|
335
|
-
"instances_count" => 1,
|
336
|
-
"stack_name" => "nginx_mongrel",
|
337
|
-
"id" => 200,
|
338
|
-
"framework_env" => "production",
|
339
|
-
"app_master" => {
|
340
|
-
"status" => "running",
|
341
|
-
"id" => 27220,
|
342
|
-
"amazon_id" => 'i-ddbbdd92',
|
343
|
-
"role" => "solo",
|
344
|
-
"public_hostname" => "app_master_hostname.compute-1.amazonaws.com"}
|
345
|
-
}, {
|
346
|
-
"ssh_username" => "ham",
|
347
|
-
"instances" => [],
|
348
|
-
"name" => "bakon",
|
349
|
-
"apps" => apps,
|
350
|
-
"instances_count" => 0,
|
351
|
-
"stack_name" => "nginx_passenger",
|
352
|
-
"id" => 8371,
|
353
|
-
"app_master" => nil,
|
354
|
-
}],
|
355
363
|
"repository_uri" => git_remote}]
|
356
364
|
end
|
357
365
|
|
358
|
-
def
|
366
|
+
def starting_app_joins
|
367
|
+
[
|
368
|
+
[1001, 200],
|
369
|
+
[1001, 202],
|
370
|
+
]
|
371
|
+
end
|
372
|
+
|
373
|
+
def starting_environments
|
359
374
|
[{
|
360
375
|
"ssh_username" => "turkey",
|
361
376
|
"instances" => [{
|
@@ -365,44 +380,29 @@ private
|
|
365
380
|
"role" => "solo",
|
366
381
|
"public_hostname" => "app_master_hostname.compute-1.amazonaws.com"}],
|
367
382
|
"name" => "giblets",
|
368
|
-
"apps" => [{
|
369
|
-
"name" => "rails232app",
|
370
|
-
"repository_uri" => git_remote}],
|
371
383
|
"instances_count" => 1,
|
372
384
|
"stack_name" => "nginx_mongrel",
|
373
385
|
"id" => 200,
|
374
386
|
"framework_env" => "production",
|
375
|
-
"app_master" => {
|
376
|
-
"status" => "running",
|
377
|
-
"id" => 27220,
|
378
|
-
"amazon_id" => 'i-ddbbdd92',
|
379
|
-
"role" => "solo",
|
380
|
-
"public_hostname" => "app_master_hostname.compute-1.amazonaws.com"}
|
381
387
|
}, {
|
382
388
|
"ssh_username" => "ham",
|
383
389
|
"instances" => [],
|
384
390
|
"name" => "bakon",
|
385
|
-
"apps" => [{
|
386
|
-
"name" => "rails232app",
|
387
|
-
"repository_uri" => git_remote}],
|
388
391
|
"instances_count" => 0,
|
389
392
|
"stack_name" => "nginx_passenger",
|
390
|
-
"id" =>
|
391
|
-
"app_master" => nil,
|
393
|
+
"id" => 202,
|
392
394
|
}, {
|
393
395
|
"ssh_username" => "hamburger",
|
394
396
|
"instances" => [],
|
395
397
|
"name" => "beef",
|
396
|
-
"apps" => [],
|
397
398
|
"instances_count" => 0,
|
398
399
|
"stack_name" => "nginx_passenger",
|
399
|
-
"id" =>
|
400
|
-
"app_master" => nil,
|
400
|
+
"id" => 206,
|
401
401
|
}]
|
402
402
|
end
|
403
403
|
end # OneAppTwoEnvs
|
404
404
|
|
405
|
-
class TwoApps <
|
405
|
+
class TwoApps < Base
|
406
406
|
def railsapp_master
|
407
407
|
{
|
408
408
|
"status" => "running",
|
@@ -427,149 +427,66 @@ private
|
|
427
427
|
end
|
428
428
|
private :keycollector_master
|
429
429
|
|
430
|
-
def
|
430
|
+
def starting_apps
|
431
431
|
[{
|
432
432
|
"id" => 3202,
|
433
433
|
"name" => "keycollector",
|
434
434
|
"repository_uri" => "git@github.com:smerritt/keycollector.git",
|
435
|
-
"instances_count" => 0,
|
436
|
-
"ssh_username" => "deploy",
|
437
|
-
"environments" => [{
|
438
|
-
"apps" => [{
|
439
|
-
"name" => "keycollector",
|
440
|
-
"repository_uri" => "git@github.com:smerritt/keycollector.git",
|
441
|
-
"id" => 3202}],
|
442
|
-
"name" => "keycollector_production",
|
443
|
-
"app_master" => keycollector_master,
|
444
|
-
"instances" => [keycollector_master],
|
445
|
-
"id" => 4359,
|
446
|
-
"framework_env" => "production",
|
447
|
-
"stack_name" => "nginx_mongrel"}],
|
448
435
|
}, {
|
449
|
-
"name" => "rails232app",
|
450
|
-
"repository_uri" => "git://github.com/smerritt/rails232app.git",
|
451
436
|
"id" => 6125,
|
452
|
-
"
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
"instances" => [railsapp_master],
|
462
|
-
"framework_env" => "production",
|
463
|
-
"id" => 200,
|
464
|
-
"stack_name" => "nginx_unicorn"}],
|
465
|
-
}]
|
437
|
+
"name" => "rails232app",
|
438
|
+
"repository_uri" => "git://github.com/smerritt/rails232app.git"}]
|
439
|
+
end
|
440
|
+
|
441
|
+
def starting_app_joins
|
442
|
+
[
|
443
|
+
[6125, 200],
|
444
|
+
[3202, 439],
|
445
|
+
]
|
466
446
|
end
|
467
447
|
|
468
|
-
def
|
448
|
+
def starting_environments
|
469
449
|
[{
|
470
450
|
"id" => 200,
|
471
451
|
"name" => "giblets",
|
452
|
+
"framework_env" => "staging",
|
472
453
|
"ssh_username" => "turkey",
|
473
454
|
"instances_count" => 1,
|
474
455
|
"instances" => [railsapp_master],
|
475
|
-
"app_master" => railsapp_master,
|
476
456
|
"stack_name" => "nginx_unicorn",
|
477
|
-
"apps" => [{
|
478
|
-
"name" => "rails232app",
|
479
|
-
"repository_uri" => "git://github.com/smerritt/rails232app.git",
|
480
|
-
"id" => 6125}],
|
481
457
|
}, {
|
482
|
-
"id" =>
|
458
|
+
"id" => 439,
|
483
459
|
"framework_env" => "production",
|
484
460
|
"name" => "keycollector_production",
|
485
461
|
"ssh_username" => "deploy",
|
486
462
|
"stack_name" => "nginx_mongrel",
|
487
463
|
"instances_count" => 1,
|
488
464
|
"instances" => [keycollector_master],
|
489
|
-
"app_master" => keycollector_master,
|
490
|
-
"apps" => [{
|
491
|
-
"name" => "keycollector",
|
492
|
-
"repository_uri" => "git@github.com:smerritt/keycollector.git",
|
493
|
-
"id" => 3202}],
|
494
465
|
}]
|
495
466
|
end
|
496
467
|
end # TwoApps
|
497
468
|
|
498
|
-
class
|
499
|
-
def
|
500
|
-
apps =
|
501
|
-
|
502
|
-
|
503
|
-
|
469
|
+
class TwoAppsSameGitUri < TwoApps
|
470
|
+
def starting_apps
|
471
|
+
apps = super
|
472
|
+
apps.each do |app|
|
473
|
+
app["repository_uri"] = "git://github.com/engineyard/dup.git"
|
474
|
+
end
|
475
|
+
apps
|
476
|
+
end
|
477
|
+
end # TwoAppsSameGitUri
|
504
478
|
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
"id" => 27220,
|
511
|
-
"amazon_id" => 'i-ddbbdd92',
|
512
|
-
"role" => "solo",
|
513
|
-
"public_hostname" => "app_master_hostname.compute-1.amazonaws.com"}],
|
514
|
-
"name" => "railsapp_production",
|
515
|
-
"apps" => apps,
|
516
|
-
"instances_count" => 1,
|
517
|
-
"stack_name" => "nginx_mongrel",
|
518
|
-
"framework_env" => "production",
|
519
|
-
"id" => 200,
|
520
|
-
"app_master" => {
|
521
|
-
"status" => "running",
|
522
|
-
"id" => 27220,
|
523
|
-
"amazon_id" => 'i-ddbbdd92',
|
524
|
-
"role" => "solo",
|
525
|
-
"public_hostname" => "app_master_hostname.compute-1.amazonaws.com",
|
526
|
-
},
|
527
|
-
}, {
|
528
|
-
"ssh_username" => "ham",
|
529
|
-
"instances" => [{
|
530
|
-
"public_hostname" => '127.3.2.1',
|
531
|
-
"status" => "running",
|
532
|
-
"id" => 63066,
|
533
|
-
"role" => "solo",
|
534
|
-
}],
|
535
|
-
"name" => "railsapp_staging",
|
536
|
-
"apps" => apps,
|
537
|
-
"instances_count" => 1,
|
538
|
-
"stack_name" => "nginx_passenger",
|
539
|
-
"id" => 8371,
|
540
|
-
"framework_env" => "production",
|
541
|
-
"app_master" => {
|
542
|
-
"public_hostname" => '127.3.2.1',
|
543
|
-
"status" => "running",
|
544
|
-
"id" => 63066,
|
545
|
-
"role" => "solo",
|
546
|
-
},
|
547
|
-
}, {
|
548
|
-
"ssh_username" => "ham",
|
549
|
-
"instances" => [{
|
550
|
-
"status" => "running",
|
551
|
-
"id" => 59395,
|
552
|
-
"role" => "solo",
|
553
|
-
"public_hostname" => "app_master_hostname.compute-1.amazonaws.com",
|
554
|
-
}],
|
555
|
-
"name" => "railsapp_staging_2",
|
556
|
-
"apps" => apps,
|
557
|
-
"instances_count" => 1,
|
558
|
-
"stack_name" => "nginx_passenger",
|
559
|
-
"id" => 8371,
|
560
|
-
"framework_env" => "production",
|
561
|
-
"app_master" => {
|
562
|
-
"public_hostname" => '127.44.55.66',
|
563
|
-
"status" => "running",
|
564
|
-
"id" => 59395,
|
565
|
-
"role" => "solo",
|
566
|
-
},
|
567
|
-
}],
|
479
|
+
class OneAppManySimilarlyNamedEnvs < Base
|
480
|
+
def starting_apps
|
481
|
+
[{
|
482
|
+
"id" => 1001,
|
483
|
+
"name" => "rails232app",
|
568
484
|
"repository_uri" => git_remote}]
|
569
485
|
end
|
570
486
|
|
571
|
-
def
|
487
|
+
def starting_environments
|
572
488
|
[{
|
489
|
+
"id" => 200,
|
573
490
|
"ssh_username" => "turkey",
|
574
491
|
"instances" => [{
|
575
492
|
"status" => "running",
|
@@ -578,77 +495,44 @@ private
|
|
578
495
|
"role" => "solo",
|
579
496
|
"public_hostname" => "app_master_hostname.compute-1.amazonaws.com"}],
|
580
497
|
"name" => "railsapp_production",
|
581
|
-
"apps" => [{
|
582
|
-
"name" => "rails232app",
|
583
|
-
"repository_uri" => git_remote}],
|
584
498
|
"instances_count" => 1,
|
585
499
|
"stack_name" => "nginx_mongrel",
|
586
|
-
"id" => 200,
|
587
500
|
"framework_env" => "production",
|
588
|
-
"app_master" => {
|
589
|
-
"public_hostname" => "app_master_hostname.compute-1.amazonaws.com",
|
590
|
-
"status" => "running",
|
591
|
-
"id" => 27220,
|
592
|
-
"amazon_id" => 'i-ddbbdd92',
|
593
|
-
"role" => "solo"},
|
594
501
|
}, {
|
502
|
+
"id" => 202,
|
595
503
|
"ssh_username" => "ham",
|
596
504
|
"instances" => [{
|
597
505
|
"public_hostname" => '127.3.2.1',
|
598
506
|
"status" => "running",
|
599
507
|
"id" => 63066,
|
600
|
-
"amazon_id" => 'i-09fec72a',
|
601
508
|
"role" => "solo",
|
602
509
|
}],
|
603
510
|
"name" => "railsapp_staging",
|
604
|
-
"apps" => [{
|
605
|
-
"name" => "rails232app",
|
606
|
-
"repository_uri" => git_remote}],
|
607
511
|
"instances_count" => 1,
|
608
512
|
"stack_name" => "nginx_passenger",
|
609
|
-
"id" => 8371,
|
610
513
|
"framework_env" => "production",
|
611
|
-
"app_master" => {
|
612
|
-
"public_hostname" => '127.3.2.1',
|
613
|
-
"status" => "running",
|
614
|
-
"id" => 63066,
|
615
|
-
"amazon_id" => 'i-09fec72a',
|
616
|
-
"role" => "solo",
|
617
|
-
},
|
618
514
|
}, {
|
619
|
-
"ssh_username" => "
|
515
|
+
"ssh_username" => "ham",
|
620
516
|
"instances" => [{
|
621
|
-
"public_hostname" => '127.44.55.66',
|
622
517
|
"status" => "running",
|
623
518
|
"id" => 59395,
|
624
|
-
"amazon_id" => 'i-1aa1e271',
|
625
519
|
"role" => "solo",
|
520
|
+
"public_hostname" => "ec2-174-129-198-124.compute-1.amazonaws.com",
|
626
521
|
}],
|
627
522
|
"name" => "railsapp_staging_2",
|
628
|
-
"apps" => [{
|
629
|
-
"name" => "rails232app",
|
630
|
-
"repository_uri" => git_remote}],
|
631
523
|
"instances_count" => 1,
|
632
524
|
"stack_name" => "nginx_passenger",
|
633
|
-
"id" =>
|
525
|
+
"id" => 204,
|
634
526
|
"framework_env" => "production",
|
635
|
-
"app_master" => {
|
636
|
-
"public_hostname" => '127.44.55.66',
|
637
|
-
"status" => "running",
|
638
|
-
"id" => 59395,
|
639
|
-
"amazon_id" => 'i-1aa1e271',
|
640
|
-
"role" => "solo",
|
641
|
-
},
|
642
527
|
}]
|
643
528
|
end
|
644
529
|
|
645
|
-
def
|
646
|
-
[
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
}]
|
530
|
+
def starting_app_joins
|
531
|
+
[
|
532
|
+
[1001, 200],
|
533
|
+
[1001, 202],
|
534
|
+
[1001, 204],
|
535
|
+
]
|
652
536
|
end
|
653
537
|
end # OneAppManySimilarlyNamedEnvs
|
654
538
|
end
|