Created
December 11, 2009 20:00
-
-
Save seamusabshere/254466 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# (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