Skip to content

Instantly share code, notes, and snippets.

@seamusabshere
Created December 11, 2009 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seamusabshere/254466 to your computer and use it in GitHub Desktop.
Save seamusabshere/254466 to your computer and use it in GitHub Desktop.
# (1) clone app_production to app_staging
# (2) hit it a couple times so it can cache any s3/etc. data it needs to start up (once you change the data, s3/etc. won't work)
# (3) cap y2k:set DATE="2010-01-01"
# (4) ...test the site...
# (5) cap y2k:unset
task :app_staging do
set :rails_env, 'production'
set :deploy_to, '/data/app'
role :app, "ec2-X-X-X-X.compute-1.amazonaws.com"
role :app, "ec2-Y-Y-Y-Y.compute-1.amazonaws.com"
role :db, "ec2-Z-Z-Z-Z.compute-1.amazonaws.com"
end
namespace :y2k do
task :set, :roles => [:app, :db] do
raise "need DATE" unless ENV['DATE'].present?
app_staging
run "#{sudo} sh -c \"echo 1 > /proc/sys/xen/independent_wallclock\""
run "#{sudo} date --set=\"#{ENV['DATE']}\""
run 'date'
end
task :unset, :roles => [:app, :db] do
app_staging
Time.zone = "Pacific Time (US & Canada)"
run "#{sudo} sh -c \"echo 1 > /proc/sys/xen/independent_wallclock\""
run "#{sudo} date --set=\"#{Time.zone.now}\""
run "#{sudo} sh -c \"echo 1 > /proc/sys/xen/independent_wallclock\""
run 'date'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment