Created
February 11, 2009 16:50
-
-
Save rufo/62115 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
# this is dependent on the yaml_db plugin at http://github.com/adamwiggins/yaml_db/tree/master | |
# also, you may not need the RAILS_ENV bit - we do multi-stage deployments | |
namespace :data do | |
desc "Updates staging server database with contents of local development" | |
task :update_server, :roles => :db do | |
system "rake db:data:dump" | |
upload "db/data.yml", "#{current_release}/db/data.yml" | |
run "cd #{current_release}; RAILS_ENV=#{rails_env} rake db:data:load" | |
end | |
desc "Updates local database with contents of staging server" | |
task :update_local, :roles => :db do | |
run "cd #{current_release}; RAILS_ENV=#{rails_env} rake db:data:dump" | |
download "#{current_release}/db/data.yml", "db/data.yml" | |
system "rake db:data:load" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment