Skip to content

Instantly share code, notes, and snippets.

@rufo
Created February 11, 2009 16:50
Show Gist options
  • Save rufo/62115 to your computer and use it in GitHub Desktop.
Save rufo/62115 to your computer and use it in GitHub Desktop.
# 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