engineyard-serverside 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -60,7 +60,7 @@ module EY
60
60
  end
61
61
 
62
62
  def create_revision_file_command
63
- strategy.create_revision_file_command(config.paths.active_release)
63
+ strategy.create_revision_file_command(paths.active_release)
64
64
  end
65
65
 
66
66
  def short_log_message(revision)
@@ -68,7 +68,7 @@ module EY
68
68
  end
69
69
 
70
70
  def parse_configured_services
71
- result = YAML.load_file "#{config.paths.shared_config}/ey_services_config_deploy.yml"
71
+ result = YAML.load_file "#{paths.shared_config}/ey_services_config_deploy.yml"
72
72
  return {} unless result.is_a?(Hash)
73
73
  result
74
74
  rescue
@@ -84,19 +84,26 @@ module EY
84
84
  end
85
85
  end
86
86
 
87
+ # The nodatabase.yml file is dropped by server configuration when there is
88
+ # no database in the cluster.
89
+ def has_database?
90
+ paths.shared_config.join('database.yml').exist? &&
91
+ !paths.shared_config.join('nodatabase.yml').exist?
92
+ end
93
+
87
94
  def check_repository
88
95
  if gemfile?
89
96
  shell.status "Gemfile found."
90
97
  if lockfile
91
98
  shell.status "Gemfile.lock found."
92
- if !config.ignore_database_adapter_warning? && !lockfile.any_database_adapter?
99
+ if !config.ignore_database_adapter_warning? && has_database? && !lockfile.any_database_adapter?
93
100
  shell.warning <<-WARN
94
101
  Gemfile.lock does not contain a recognized database adapter.
95
- A database-adapter gem such as mysql2, mysql, or do_mysql was expected.
96
- This can prevent applications that use MySQL or PostreSQL from booting.
102
+ A database-adapter gem such as pg, mysql2, mysql, or do_mysql was expected.
103
+ This can prevent applications that use PostgreSQL or MySQL from booting.
97
104
 
98
105
  To fix, add any needed adapter to your Gemfile, bundle, commit, and redeploy.
99
- Applications not using MySQL or PostgreSQL can safely ignore this warning by
106
+ Applications not using PostgreSQL or MySQL can safely ignore this warning by
100
107
  adding ignore_database_adapter_warning: true to the application's ey.yml file
101
108
  under this environment's name and adding the file to your repository.
102
109
  WARN
@@ -142,7 +149,7 @@ To fix this problem, commit your Gemfile.lock to your repository and redeploy.
142
149
  def push_code
143
150
  shell.status "Pushing code to all servers"
144
151
  commands = servers.remote.map do |server|
145
- cmd = server.sync_directory_command(config.paths.repository_cache)
152
+ cmd = server.sync_directory_command(paths.repository_cache)
146
153
  proc { shell.logged_system(cmd) }
147
154
  end
148
155
  futures = EY::Serverside::Future.call(commands)
@@ -174,7 +181,7 @@ To fix this problem, commit your Gemfile.lock to your repository and redeploy.
174
181
  roles :app_master, :app, :solo, :util do
175
182
  run(generate_ssh_wrapper)
176
183
  end
177
- config.paths.ssh_wrapper
184
+ paths.ssh_wrapper
178
185
  end
179
186
  end
180
187
 
@@ -184,13 +191,13 @@ To fix this problem, commit your Gemfile.lock to your repository and redeploy.
184
191
  # Learned this at http://lists.mindrot.org/pipermail/openssh-unix-dev/2009-February/027271.html
185
192
  # (Thanks Jim L.)
186
193
  def generate_ssh_wrapper
187
- path = config.paths.ssh_wrapper
194
+ path = paths.ssh_wrapper
188
195
  <<-SCRIPT
189
196
  mkdir -p #{path.dirname}
190
197
  [[ -x #{path} ]] || cat > #{path} <<'SSH'
191
198
  #!/bin/sh
192
199
  unset SSH_AUTH_SOCK
193
- ssh -o CheckHostIP=no -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o LogLevel=INFO -o IdentityFile=#{config.paths.deploy_key} -o IdentitiesOnly=yes $*
200
+ ssh -o CheckHostIP=no -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o LogLevel=INFO -o IdentityFile=#{paths.deploy_key} -o IdentitiesOnly=yes $*
194
201
  SSH
195
202
  chmod 0700 #{path}
196
203
  SCRIPT
@@ -206,8 +213,8 @@ chmod 0700 #{path}
206
213
 
207
214
  # task
208
215
  def cleanup_old_releases
209
- clean_release_directory(config.paths.releases)
210
- clean_release_directory(config.paths.releases_failed)
216
+ clean_release_directory(paths.releases)
217
+ clean_release_directory(paths.releases_failed)
211
218
  end
212
219
 
213
220
  # Remove all but the most-recent +count+ releases from the specified
@@ -226,7 +233,7 @@ chmod 0700 #{path}
226
233
  def rollback
227
234
  if config.rollback_paths!
228
235
  begin
229
- rolled_back_release = config.paths.latest_release
236
+ rolled_back_release = paths.latest_release
230
237
  shell.status "Rolling back to previous release: #{short_log_message(config.active_revision)}"
231
238
  run_with_callbacks(:symlink)
232
239
  sudo "rm -rf #{rolled_back_release}"
@@ -251,7 +258,7 @@ chmod 0700 #{path}
251
258
  def migrate
252
259
  return unless config.migrate?
253
260
  @migrations_reached = true
254
- cmd = "cd #{config.paths.active_release} && PATH=#{config.paths.binstubs}:$PATH #{config.framework_envs} #{config.migration_command}"
261
+ cmd = "cd #{paths.active_release} && PATH=#{paths.binstubs}:$PATH #{config.framework_envs} #{config.migration_command}"
255
262
  roles :app_master, :solo do
256
263
  shell.status "Migrating: #{cmd}"
257
264
  run(cmd)
@@ -260,12 +267,12 @@ chmod 0700 #{path}
260
267
 
261
268
  # task
262
269
  def copy_repository_cache
263
- shell.status "Copying to #{config.paths.active_release}"
270
+ shell.status "Copying to #{paths.active_release}"
264
271
  exclusions = Array(config.copy_exclude).map { |e| %|--exclude="#{e}"| }.join(' ')
265
- run("mkdir -p #{config.paths.active_release} #{config.paths.releases_failed} #{config.paths.shared_config} && rsync -aq #{exclusions} #{config.paths.repository_cache}/ #{config.paths.active_release}")
272
+ run("mkdir -p #{paths.active_release} #{paths.releases_failed} #{paths.shared_config} && rsync -aq #{exclusions} #{paths.repository_cache}/ #{paths.active_release}")
266
273
 
267
274
  shell.status "Ensuring proper ownership."
268
- sudo("chown -R #{config.user}:#{config.group} #{config.paths.active_release} #{config.paths.releases_failed}")
275
+ sudo("chown -R #{config.user}:#{config.group} #{paths.active_release} #{paths.releases_failed}")
269
276
  end
270
277
 
271
278
  def create_revision_file
@@ -303,19 +310,19 @@ Deploy again if your services configuration appears incomplete or out of date.
303
310
  def setup_sqlite3_if_necessary
304
311
  if gemfile? && lockfile && lockfile.uses_sqlite3?
305
312
  [
306
- ["Create databases directory if needed", "mkdir -p #{config.paths.shared}/databases"],
307
- ["Creating SQLite database if needed", "touch #{config.paths.shared}/databases/#{config.framework_env}.sqlite3"],
308
- ["Create config directory if needed", "mkdir -p #{config.paths.active_release_config}"],
313
+ ["Create databases directory if needed", "mkdir -p #{paths.shared}/databases"],
314
+ ["Creating SQLite database if needed", "touch #{paths.shared}/databases/#{config.framework_env}.sqlite3"],
315
+ ["Create config directory if needed", "mkdir -p #{paths.active_release_config}"],
309
316
  ["Generating SQLite config", <<-WRAP],
310
- cat > #{config.paths.shared_config}/database.sqlite3.yml<<'YML'
317
+ cat > #{paths.shared_config}/database.sqlite3.yml<<'YML'
311
318
  #{config.framework_env}:
312
319
  adapter: sqlite3
313
- database: #{config.paths.shared}/databases/#{config.framework_env}.sqlite3
320
+ database: #{paths.shared}/databases/#{config.framework_env}.sqlite3
314
321
  pool: 5
315
322
  timeout: 5000
316
323
  YML
317
324
  WRAP
318
- ["Symlink database.yml", "ln -nfs #{config.paths.shared_config}/database.sqlite3.yml #{config.paths.active_release_config}/database.yml"],
325
+ ["Symlink database.yml", "ln -nfs #{paths.shared_config}/database.sqlite3.yml #{paths.active_release_config}/database.yml"],
319
326
  ].each do |what, cmd|
320
327
  shell.status "#{what}"
321
328
  run(cmd)
@@ -323,7 +330,7 @@ WRAP
323
330
 
324
331
  owner = [config.user, config.group].join(':')
325
332
  shell.status "Setting ownership to #{owner}"
326
- sudo "chown -R #{owner} #{config.paths.active_release}"
333
+ sudo "chown -R #{owner} #{paths.active_release}"
327
334
  end
328
335
  end
329
336
 
@@ -335,40 +342,40 @@ WRAP
335
342
  end
336
343
  owner = [config.user, config.group].join(':')
337
344
  shell.status "Setting ownership to #{owner}"
338
- sudo "chown -R #{owner} #{config.paths.active_release}"
345
+ sudo "chown -R #{owner} #{paths.active_release}"
339
346
  end
340
347
 
341
348
  def symlink_tasks
342
349
  [
343
- ["Set group write permissions", "chmod -R g+w #{config.paths.active_release}"],
344
- ["Remove revision-tracked shared directories from deployment", "rm -rf #{config.paths.active_log} #{config.paths.public_system} #{config.paths.active_release}/tmp/pids"],
345
- ["Create tmp directory", "mkdir -p #{config.paths.active_release}/tmp"],
346
- ["Symlink shared log directory", "ln -nfs #{config.paths.shared_log} #{config.paths.active_log}"],
347
- ["Create public directory if needed", "mkdir -p #{config.paths.public}"],
348
- ["Create config directory if needed", "mkdir -p #{config.paths.active_release_config}"],
349
- ["Create system directory if needed", "ln -nfs #{config.paths.shared_system} #{config.paths.public_system}"],
350
- ["Symlink shared pids directory", "ln -nfs #{config.paths.shared}/pids #{config.paths.active_release}/tmp/pids"],
351
- ["Symlink other shared config files", "find #{config.paths.shared_config} -type f -not -name 'database.yml' -exec ln -s {} #{config.paths.active_release_config} \\;"],
352
- ["Symlink mongrel_cluster.yml", "ln -nfs #{config.paths.shared_config}/mongrel_cluster.yml #{config.paths.active_release_config}/mongrel_cluster.yml"],
353
- ["Symlink database.yml", "ln -nfs #{config.paths.shared_config}/database.yml #{config.paths.active_release_config}/database.yml"],
354
- ["Symlink newrelic.yml if needed", "if [ -f \"#{config.paths.shared_config}/newrelic.yml\" ]; then ln -nfs #{config.paths.shared_config}/newrelic.yml #{config.paths.active_release_config}/newrelic.yml; fi"],
350
+ ["Set group write permissions", "chmod -R g+w #{paths.active_release}"],
351
+ ["Remove symlinked shared directories", "rm -rf #{paths.active_log} #{paths.public_system} #{paths.active_release}/tmp/pids"],
352
+ ["Create tmp directory", "mkdir -p #{paths.active_release}/tmp"],
353
+ ["Create public directory", "mkdir -p #{paths.public}"],
354
+ ["Create config directory", "mkdir -p #{paths.active_release_config}"],
355
+ ["Symlink shared log directory", "ln -nfs #{paths.shared_log} #{paths.active_log}"],
356
+ ["Lymlink pubilc system directory", "ln -nfs #{paths.shared_system} #{paths.public_system}"],
357
+ ["Symlink shared pids directory", "ln -nfs #{paths.shared}/pids #{paths.active_release}/tmp/pids"],
358
+ ["Symlink other shared config files", "find #{paths.shared_config} -type f -not -name 'database.yml' -exec ln -s {} #{paths.active_release_config} \\;"],
359
+ ["Symlink database.yml if needed", "if [ -f \"#{paths.shared_config}/database.yml\" ]; then ln -nfs #{paths.shared_config}/database.yml #{paths.active_release_config}/database.yml; fi"],
360
+ ["Symlink newrelic.yml if needed", "if [ -f \"#{paths.shared_config}/newrelic.yml\" ]; then ln -nfs #{paths.shared_config}/newrelic.yml #{paths.active_release_config}/newrelic.yml; fi"],
361
+ ["Symlink mongrel_cluster.yml if needed", "if [ -f \"#{paths.shared_config}/mongrel_cluster.yml\" ]; then ln -nfs #{paths.shared_config}/mongrel_cluster.yml #{paths.active_release_config}/mongrel_cluster.yml; fi"],
355
362
  ]
356
363
  end
357
364
 
358
365
  # task
359
366
  def symlink
360
367
  shell.status "Symlinking code."
361
- run "rm -f #{config.paths.current} && ln -nfs #{config.paths.active_release} #{config.paths.current} && find #{config.paths.current} -not -user #{config.user} -or -not -group #{config.group} -exec chown #{config.user}:#{config.group} {} +"
368
+ run "rm -f #{paths.current} && ln -nfs #{paths.active_release} #{paths.current} && find #{paths.current} -not -user #{config.user} -or -not -group #{config.group} -exec chown #{config.user}:#{config.group} {} +"
362
369
  @symlink_changed = true
363
370
  rescue Exception
364
- sudo "rm -f #{config.paths.current} && ln -nfs #{config.paths.previous_release(config.paths.active_release)} #{config.paths.current} && chown -R #{config.user}:#{config.group} #{config.paths.current}"
371
+ sudo "rm -f #{paths.current} && ln -nfs #{paths.previous_release(paths.active_release)} #{paths.current} && chown -R #{config.user}:#{config.group} #{paths.current}"
365
372
  @symlink_changed = false
366
373
  raise
367
374
  end
368
375
 
369
376
  def callback(what)
370
377
  @callbacks_reached ||= true
371
- if config.paths.deploy_hook(what).exist?
378
+ if paths.deploy_hook(what).exist?
372
379
  shell.status "Running deploy hook: deploy/#{what}.rb"
373
380
  run Escape.shell_command(base_callback_command_for(what)) do |server, cmd|
374
381
  per_instance_args = []
@@ -391,7 +398,7 @@ WRAP
391
398
  ENV['GIT_SSH'] = ssh_executable.to_s
392
399
  @strategy ||= config.strategy_class.new(
393
400
  shell,
394
- :repository_cache => config.paths.repository_cache.to_s,
401
+ :repository_cache => paths.repository_cache.to_s,
395
402
  :app => config.app,
396
403
  :repo => config[:repo],
397
404
  :ref => config[:branch]
@@ -399,7 +406,7 @@ WRAP
399
406
  end
400
407
 
401
408
  def gemfile?
402
- config.paths.gemfile.exist?
409
+ paths.gemfile.exist?
403
410
  end
404
411
 
405
412
  def base_callback_command_for(what)
@@ -407,7 +414,7 @@ WRAP
407
414
  cmd << '--app' << config.app
408
415
  cmd << '--environment-name' << config.environment_name
409
416
  cmd << '--account-name' << config.account_name
410
- cmd << '--release-path' << config.paths.active_release.to_s
417
+ cmd << '--release-path' << paths.active_release.to_s
411
418
  cmd << '--framework-env' << config.framework_env.to_s
412
419
  cmd << '--verbose' if config.verbose
413
420
  cmd
@@ -446,18 +453,18 @@ WRAP
446
453
  def with_failed_release_cleanup
447
454
  yield
448
455
  rescue Exception
449
- shell.status "Release #{config.paths.active_release} failed, saving release to #{config.paths.releases_failed}."
450
- sudo "mv #{config.paths.active_release} #{config.paths.releases_failed}"
451
- clean_release_directory(config.paths.releases_failed)
456
+ shell.status "Release #{paths.active_release} failed, saving release to #{paths.releases_failed}."
457
+ sudo "mv #{paths.active_release} #{paths.releases_failed}"
458
+ clean_release_directory(paths.releases_failed)
452
459
  raise
453
460
  end
454
461
 
455
462
  def bundler_config
456
463
  version = LockfileParser.default_version
457
464
  options = [
458
- "--gemfile #{config.paths.gemfile}",
459
- "--path #{config.paths.bundled_gems}",
460
- "--binstubs #{config.paths.binstubs}",
465
+ "--gemfile #{paths.gemfile}",
466
+ "--path #{paths.bundled_gems}",
467
+ "--binstubs #{paths.binstubs}",
461
468
  "--without #{config.bundle_without}"
462
469
  ]
463
470
 
@@ -470,7 +477,7 @@ WRAP
470
477
  end
471
478
 
472
479
  def lockfile
473
- lockfile_path = config.paths.gemfile_lock
480
+ lockfile_path = paths.gemfile_lock
474
481
  if lockfile_path.exist?
475
482
  @lockfile_parser ||= LockfileParser.new(lockfile_path.read)
476
483
  else
@@ -486,7 +493,7 @@ WRAP
486
493
 
487
494
  bundler_version, install_switches = bundler_config
488
495
  sudo "#{clean_environment} && #{serverside_bin} install_bundler #{bundler_version}"
489
- run "#{clean_environment} && cd #{config.paths.active_release} && ruby -S bundle _#{bundler_version}_ install #{install_switches}"
496
+ run "#{clean_environment} && cd #{paths.active_release} && ruby -S bundle _#{bundler_version}_ install #{install_switches}"
490
497
 
491
498
  write_system_version
492
499
  end
@@ -494,25 +501,26 @@ WRAP
494
501
 
495
502
  def clean_bundle_on_system_version_change
496
503
  # diff exits with 0 for same and 1/2 for different/file not found.
497
- check_ruby = "#{config.ruby_version_command} | diff - #{config.paths.ruby_version} >/dev/null 2>&1"
498
- check_system = "#{config.system_version_command} | diff - #{config.paths.system_version} >/dev/null 2>&1"
504
+ check_ruby = "#{config.ruby_version_command} | diff - #{paths.ruby_version} >/dev/null 2>&1"
505
+ check_system = "#{config.system_version_command} | diff - #{paths.system_version} >/dev/null 2>&1"
499
506
  say_cleaning = "echo 'New deploy or system version change detected, cleaning bundled gems.'"
500
- clean_bundle = "rm -Rf #{config.paths.bundled_gems}"
507
+ clean_bundle = "rm -Rf #{paths.bundled_gems}"
501
508
 
502
509
  run "#{check_ruby} && #{check_system} || (#{say_cleaning} && #{clean_bundle})"
503
510
  end
504
511
 
505
512
  def write_system_version
506
- store_ruby_version = "#{config.ruby_version_command} > #{config.paths.ruby_version}"
507
- store_system_version = "#{config.system_version_command} > #{config.paths.system_version}"
513
+ store_ruby_version = "#{config.ruby_version_command} > #{paths.ruby_version}"
514
+ store_system_version = "#{config.system_version_command} > #{paths.system_version}"
508
515
 
509
- run "mkdir -p #{config.paths.bundled_gems} && #{store_ruby_version} && #{store_system_version}"
516
+ run "mkdir -p #{paths.bundled_gems} && chown #{config.user}:#{config.group} #{paths.bundled_gems}"
517
+ run "#{store_ruby_version} && #{store_system_version}"
510
518
  end
511
519
 
512
520
  def check_node_npm
513
- if config.paths.package_json.exist?
521
+ if paths.package_json.exist?
514
522
  shell.info "~> package.json detected, installing npm packages"
515
- run "cd #{config.paths.active_release} && npm install"
523
+ run "cd #{paths.active_release} && npm install"
516
524
  end
517
525
  end
518
526
  end # DeployBase
@@ -6,7 +6,7 @@ module EY
6
6
  rails_version = bundled_rails_version
7
7
  roles :app_master, :app, :solo do
8
8
  keep_existing_assets
9
- cmd = "cd #{config.paths.active_release} && PATH=#{config.paths.binstubs}:$PATH #{config.framework_envs} rake assets:precompile"
9
+ cmd = "cd #{paths.active_release} && PATH=#{paths.binstubs}:$PATH #{config.framework_envs} rake assets:precompile"
10
10
 
11
11
  if rails_version
12
12
  shell.status "Precompiling assets for rails v#{rails_version}"
@@ -40,20 +40,20 @@ module EY
40
40
  return false
41
41
  end
42
42
 
43
- app_rb_path = config.paths.active_release_config.join('application.rb')
43
+ app_rb_path = paths.active_release_config.join('application.rb')
44
44
  unless app_rb_path.readable? # Not a Rails app in the first place.
45
45
  shell.status "Skipping asset precompilation. (not a Rails application)"
46
46
  return false
47
47
  end
48
48
 
49
- if config.paths.active_release.join('app','assets').exist?
49
+ if paths.active_release.join('app','assets').exist?
50
50
  shell.status "Attempting Rails asset precompilation. (found directory: 'app/assets')"
51
51
  else
52
52
  shell.status "Skipping asset precompilation. (directory not found: 'app/assets')"
53
53
  return false
54
54
  end
55
55
 
56
- if config.paths.public_assets.exist?
56
+ if paths.public_assets.exist?
57
57
  shell.status "Skipping asset compilation. Already compiled. (found directory: 'public/assets')"
58
58
  return false
59
59
  end
@@ -87,13 +87,13 @@ module EY
87
87
  def app_has_asset_task?
88
88
  # We just run this locally on the app master; everybody else should
89
89
  # have the same code anyway.
90
- task_check = "PATH=#{config.paths.binstubs}:$PATH #{config.framework_envs} rake -T assets:precompile |grep 'assets:precompile'"
91
- cmd = "cd #{config.paths.active_release} && #{task_check}"
92
- shell.logged_system("cd #{config.paths.active_release} && #{task_check}").success?
90
+ task_check = "PATH=#{paths.binstubs}:$PATH #{config.framework_envs} rake -T assets:precompile |grep 'assets:precompile'"
91
+ cmd = "cd #{paths.active_release} && #{task_check}"
92
+ shell.logged_system("cd #{paths.active_release} && #{task_check}").success?
93
93
  end
94
94
 
95
95
  def app_builds_own_assets?
96
- config.paths.public_assets.exist?
96
+ paths.public_assets.exist?
97
97
  end
98
98
 
99
99
  # To support operations like Unicorn's hot reload, it is useful to have
@@ -101,8 +101,8 @@ module EY
101
101
  # clients may request stale assets that you just deleted.
102
102
  # Making use of this requires a properly-configured front-end HTTP server.
103
103
  def keep_existing_assets
104
- current = config.paths.shared_assets
105
- last_asset_path = config.paths.shared.join('last_assets')
104
+ current = paths.shared_assets
105
+ last_asset_path = paths.shared.join('last_assets')
106
106
  # If there are current shared assets, move them under a 'last_assets' directory.
107
107
  run <<-COMMAND
108
108
  if [ -d #{current} ]; then
@@ -110,11 +110,11 @@ if [ -d #{current} ]; then
110
110
  else
111
111
  mkdir -p #{current} #{last_asset_path};
112
112
  fi;
113
- ln -nfs #{current} #{last_asset_path} #{config.paths.public}
113
+ ln -nfs #{current} #{last_asset_path} #{paths.public}
114
114
  COMMAND
115
115
  end
116
116
 
117
- def bundled_rails_version(lockfile_path = config.paths.gemfile_lock)
117
+ def bundled_rails_version(lockfile_path = paths.gemfile_lock)
118
118
  return unless lockfile_path.exist?
119
119
  lockfile = lockfile_path.read
120
120
  lockfile.each_line do |line|
@@ -18,9 +18,13 @@ module EY
18
18
  @roles = :all
19
19
  end
20
20
 
21
+ def paths
22
+ config.paths
23
+ end
24
+
21
25
  def require_custom_tasks
22
26
  deploy_file = ["config/eydeploy.rb", "eydeploy.rb"].map do |short_file|
23
- config.paths.repository_cache.join(short_file)
27
+ paths.repository_cache.join(short_file)
24
28
  end.detect do |file|
25
29
  file.exist?
26
30
  end
@@ -33,7 +37,7 @@ module EY
33
37
 
34
38
  def load_ey_yml
35
39
  ey_yml = ["config/ey.yml", "ey.yml"].map do |short_file|
36
- config.paths.repository_cache.join(short_file)
40
+ paths.repository_cache.join(short_file)
37
41
  end.detect do |file|
38
42
  file.exist?
39
43
  end
@@ -1,5 +1,5 @@
1
1
  module EY
2
2
  module Serverside
3
- VERSION = '2.0.1'
3
+ VERSION = '2.0.2'
4
4
  end
5
5
  end
@@ -67,7 +67,10 @@ describe "Deploying an app with ey.yml" do
67
67
 
68
68
  context "with a different ey.yml" do
69
69
  before(:all) do
70
- deploy_test_application('ey_yml_alt')
70
+ deploy_test_application('ey_yml_alt') do
71
+ deploy_dir.join('shared','config').mkpath
72
+ deploy_dir.join('shared','config','database.yml').open('w') { |f| f << 'something' }
73
+ end
71
74
  end
72
75
 
73
76
  it "always installs maintenance pages" do
@@ -79,4 +82,18 @@ describe "Deploying an app with ey.yml" do
79
82
  read_output.should =~ /WARNING: Gemfile.lock does not contain a recognized database adapter./
80
83
  end
81
84
  end
85
+
86
+ context "with nodatabase.yml" do
87
+ before(:all) do
88
+ deploy_test_application('ey_yml_alt') do
89
+ deploy_dir.join('shared','config').mkpath
90
+ deploy_dir.join('shared','config','nodatabase.yml').open('w') { |f| f << 'something' }
91
+ end
92
+
93
+ end
94
+
95
+ it "doesn't display the database adapter warning" do
96
+ read_output.should_not =~ /WARNING: Gemfile.lock does not contain a recognized database adapter./
97
+ end
98
+ end
82
99
  end
metadata CHANGED
@@ -1,110 +1,119 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: engineyard-serverside
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 2
7
- - 0
8
- - 1
9
- version: 2.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.2
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - EY Cloud Team
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2012-08-21 00:00:00 -07:00
18
- default_executable: engineyard-serverside
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- type: :development
22
- version_requirements: &id001 !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "="
25
- - !ruby/object:Gem::Version
26
- segments:
27
- - 1
28
- - 3
29
- - 2
30
- version: 1.3.2
12
+ date: 2012-09-19 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
31
15
  name: rspec
32
- requirement: *id001
33
- prerelease: false
34
- - !ruby/object:Gem::Dependency
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - '='
20
+ - !ruby/object:Gem::Version
21
+ version: 1.3.2
35
22
  type: :development
36
- version_requirements: &id002 !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- segments:
41
- - 0
42
- - 9
43
- - 2
44
- - 2
45
- version: 0.9.2.2
46
- name: rake
47
- requirement: *id002
48
23
  prerelease: false
49
- - !ruby/object:Gem::Dependency
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - '='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.3.2
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: 0.9.2.2
50
38
  type: :development
51
- version_requirements: &id003 !ruby/object:Gem::Requirement
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- segments:
56
- - 0
57
- version: "0"
58
- name: rdoc
59
- requirement: *id003
60
39
  prerelease: false
61
- - !ruby/object:Gem::Dependency
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 0.9.2.2
46
+ - !ruby/object:Gem::Dependency
47
+ name: rdoc
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
62
54
  type: :development
63
- version_requirements: &id004 !ruby/object:Gem::Requirement
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- segments:
68
- - 0
69
- version: "0"
70
- name: timecop
71
- requirement: *id004
72
55
  prerelease: false
73
- - !ruby/object:Gem::Dependency
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: timecop
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
74
70
  type: :development
75
- version_requirements: &id005 !ruby/object:Gem::Requirement
76
- requirements:
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- segments:
80
- - 0
81
- version: "0"
82
- name: simplecov
83
- requirement: *id005
84
71
  prerelease: false
85
- - !ruby/object:Gem::Dependency
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: simplecov
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
86
  type: :development
87
- version_requirements: &id006 !ruby/object:Gem::Requirement
88
- requirements:
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: engineyard-cloud-client
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
89
99
  - - ~>
90
- - !ruby/object:Gem::Version
91
- segments:
92
- - 1
93
- - 0
94
- - 5
100
+ - !ruby/object:Gem::Version
95
101
  version: 1.0.5
96
- name: engineyard-cloud-client
97
- requirement: *id006
102
+ type: :development
98
103
  prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 1.0.5
99
110
  description:
100
111
  email: cloud@engineyard.com
101
- executables:
112
+ executables:
102
113
  - engineyard-serverside
103
114
  extensions: []
104
-
105
115
  extra_rdoc_files: []
106
-
107
- files:
116
+ files:
108
117
  - bin/engineyard-serverside
109
118
  - lib/engineyard-serverside/cli.rb
110
119
  - lib/engineyard-serverside/cli_helpers.rb
@@ -349,39 +358,139 @@ files:
349
358
  - lib/vendor/thor/README.md
350
359
  - lib/vendor/thor/thor.gemspec
351
360
  - LICENSE
352
- has_rdoc: true
361
+ - spec/basic_deploy_spec.rb
362
+ - spec/bundler_deploy_spec.rb
363
+ - spec/configuration_spec.rb
364
+ - spec/custom_deploy_spec.rb
365
+ - spec/deploy_hook_spec.rb
366
+ - spec/deprecation_spec.rb
367
+ - spec/ey_yml_customized_deploy_spec.rb
368
+ - spec/fixtures/gitrepo/bar
369
+ - spec/fixtures/gitrepo/foo
370
+ - spec/fixtures/gitrepo.tar.gz
371
+ - spec/fixtures/invalid_hook.rb
372
+ - spec/fixtures/lockfiles/0.9-no-bundler
373
+ - spec/fixtures/lockfiles/0.9-with-bundler
374
+ - spec/fixtures/lockfiles/1.0-no-bundler
375
+ - spec/fixtures/lockfiles/1.0.0.rc.1-with-bundler
376
+ - spec/fixtures/lockfiles/1.0.18-do_mysql
377
+ - spec/fixtures/lockfiles/1.0.18-do_postgres
378
+ - spec/fixtures/lockfiles/1.0.18-mysql
379
+ - spec/fixtures/lockfiles/1.0.18-mysql2
380
+ - spec/fixtures/lockfiles/1.0.18-pg
381
+ - spec/fixtures/lockfiles/1.0.6-no-bundler
382
+ - spec/fixtures/lockfiles/1.0.6-with-any-bundler
383
+ - spec/fixtures/lockfiles/1.0.6-with-bundler
384
+ - spec/fixtures/lockfiles/not-a-lockfile
385
+ - spec/fixtures/repos/assets_disabled/app/assets/empty
386
+ - spec/fixtures/repos/assets_disabled/config/application.rb
387
+ - spec/fixtures/repos/assets_disabled/Gemfile
388
+ - spec/fixtures/repos/assets_disabled/Gemfile.lock
389
+ - spec/fixtures/repos/assets_disabled/Rakefile
390
+ - spec/fixtures/repos/assets_disabled/README
391
+ - spec/fixtures/repos/assets_disabled_in_ey_yml/app/assets/empty
392
+ - spec/fixtures/repos/assets_disabled_in_ey_yml/config/application.rb
393
+ - spec/fixtures/repos/assets_disabled_in_ey_yml/config/ey.yml
394
+ - spec/fixtures/repos/assets_disabled_in_ey_yml/Gemfile
395
+ - spec/fixtures/repos/assets_disabled_in_ey_yml/Gemfile.lock
396
+ - spec/fixtures/repos/assets_disabled_in_ey_yml/Rakefile
397
+ - spec/fixtures/repos/assets_disabled_in_ey_yml/README
398
+ - spec/fixtures/repos/assets_enabled/app/assets/empty
399
+ - spec/fixtures/repos/assets_enabled/config/application.rb
400
+ - spec/fixtures/repos/assets_enabled/Gemfile
401
+ - spec/fixtures/repos/assets_enabled/Gemfile.lock
402
+ - spec/fixtures/repos/assets_enabled/Rakefile
403
+ - spec/fixtures/repos/assets_enabled/README
404
+ - spec/fixtures/repos/assets_enabled_in_ey_yml/config/ey.yml
405
+ - spec/fixtures/repos/assets_enabled_in_ey_yml/Gemfile
406
+ - spec/fixtures/repos/assets_enabled_in_ey_yml/Gemfile.lock
407
+ - spec/fixtures/repos/assets_enabled_in_ey_yml/Rakefile
408
+ - spec/fixtures/repos/assets_enabled_in_ey_yml/README
409
+ - spec/fixtures/repos/assets_in_hook/app/assets/empty
410
+ - spec/fixtures/repos/assets_in_hook/config/application.rb
411
+ - spec/fixtures/repos/assets_in_hook/deploy/before_compile_assets.rb
412
+ - spec/fixtures/repos/assets_in_hook/Gemfile
413
+ - spec/fixtures/repos/assets_in_hook/Gemfile.lock
414
+ - spec/fixtures/repos/assets_in_hook/Rakefile
415
+ - spec/fixtures/repos/assets_in_hook/README
416
+ - spec/fixtures/repos/default/Gemfile
417
+ - spec/fixtures/repos/default/Gemfile.lock
418
+ - spec/fixtures/repos/default/README
419
+ - spec/fixtures/repos/ey_yml/config/ey.yml
420
+ - spec/fixtures/repos/ey_yml/deploy/before_migrate.rb
421
+ - spec/fixtures/repos/ey_yml/Gemfile
422
+ - spec/fixtures/repos/ey_yml/Gemfile.lock
423
+ - spec/fixtures/repos/ey_yml/README
424
+ - spec/fixtures/repos/ey_yml_alt/deploy/before_migrate.rb
425
+ - spec/fixtures/repos/ey_yml_alt/ey.yml
426
+ - spec/fixtures/repos/ey_yml_alt/Gemfile
427
+ - spec/fixtures/repos/ey_yml_alt/Gemfile.lock
428
+ - spec/fixtures/repos/ey_yml_alt/README
429
+ - spec/fixtures/repos/hook_fails/deploy/before_migrate.rb
430
+ - spec/fixtures/repos/hook_fails/README
431
+ - spec/fixtures/repos/hooks/deploy/after_bundle.rb
432
+ - spec/fixtures/repos/hooks/deploy/after_compile_assets.rb
433
+ - spec/fixtures/repos/hooks/deploy/after_migrate.rb
434
+ - spec/fixtures/repos/hooks/deploy/after_restart.rb
435
+ - spec/fixtures/repos/hooks/deploy/after_symlink.rb
436
+ - spec/fixtures/repos/hooks/deploy/before_bundle.rb
437
+ - spec/fixtures/repos/hooks/deploy/before_compile_assets.rb
438
+ - spec/fixtures/repos/hooks/deploy/before_migrate.rb
439
+ - spec/fixtures/repos/hooks/deploy/before_restart.rb
440
+ - spec/fixtures/repos/hooks/deploy/before_symlink.rb
441
+ - spec/fixtures/repos/hooks/README
442
+ - spec/fixtures/repos/no_ey_config/Gemfile
443
+ - spec/fixtures/repos/no_ey_config/Gemfile.lock
444
+ - spec/fixtures/repos/no_ey_config/README
445
+ - spec/fixtures/repos/no_gemfile_lock/Gemfile
446
+ - spec/fixtures/repos/no_gemfile_lock/README
447
+ - spec/fixtures/repos/nodejs/package.json
448
+ - spec/fixtures/repos/nodejs/README
449
+ - spec/fixtures/repos/not_bundled/README
450
+ - spec/fixtures/repos/sqlite3/Gemfile
451
+ - spec/fixtures/repos/sqlite3/Gemfile.lock
452
+ - spec/fixtures/repos/sqlite3/README
453
+ - spec/fixtures/valid_hook.rb
454
+ - spec/git_strategy_spec.rb
455
+ - spec/lockfile_parser_spec.rb
456
+ - spec/nodejs_deploy_spec.rb
457
+ - spec/rails31_deploy_spec.rb
458
+ - spec/restart_spec.rb
459
+ - spec/rollback_spec.rb
460
+ - spec/server_spec.rb
461
+ - spec/services_deploy_spec.rb
462
+ - spec/shell_spec.rb
463
+ - spec/spec_helper.rb
464
+ - spec/sqlite3_deploy_spec.rb
465
+ - spec/support/integration.rb
353
466
  homepage: http://github.com/engineyard/engineyard-serverside
354
467
  licenses: []
355
-
356
468
  post_install_message:
357
469
  rdoc_options: []
358
-
359
- require_paths:
470
+ require_paths:
360
471
  - lib
361
- required_ruby_version: !ruby/object:Gem::Requirement
362
- requirements:
363
- - - ">="
364
- - !ruby/object:Gem::Version
365
- segments:
472
+ required_ruby_version: !ruby/object:Gem::Requirement
473
+ none: false
474
+ requirements:
475
+ - - ! '>='
476
+ - !ruby/object:Gem::Version
477
+ version: '0'
478
+ segments:
366
479
  - 0
367
- version: "0"
368
- required_rubygems_version: !ruby/object:Gem::Requirement
369
- requirements:
370
- - - ">="
371
- - !ruby/object:Gem::Version
372
- segments:
373
- - 1
374
- - 3
375
- - 6
480
+ hash: -2910105700547415890
481
+ required_rubygems_version: !ruby/object:Gem::Requirement
482
+ none: false
483
+ requirements:
484
+ - - ! '>='
485
+ - !ruby/object:Gem::Version
376
486
  version: 1.3.6
377
487
  requirements: []
378
-
379
488
  rubyforge_project:
380
- rubygems_version: 1.3.6
489
+ rubygems_version: 1.8.24
381
490
  signing_key:
382
491
  specification_version: 3
383
492
  summary: A gem that deploys ruby applications on EY Cloud instances
384
- test_files:
493
+ test_files:
385
494
  - spec/basic_deploy_spec.rb
386
495
  - spec/bundler_deploy_spec.rb
387
496
  - spec/configuration_spec.rb