Skip to content

Instantly share code, notes, and snippets.

@camwest
Created April 21, 2009 21:45
Show Gist options
  • Save camwest/99409 to your computer and use it in GitHub Desktop.
Save camwest/99409 to your computer and use it in GitHub Desktop.
desc "Push Content from Staging to Production."
task :content_to_production, :roles => :db, :only => { :primary => true } do
backup_name
on_rollback { run "rm -f #{backup_file}" }
run "mysqldump --add-drop-table -h #{staging_dbhost} -u #{dbuser} -p#{dbpass} #{staging_database} asset_directories assets authors chapter_overviews content_types contents cue_points mime_types multiple_choices nominal_role_infos nominal_roles overviews progress_tests question_options roles training_materials videos > #{backup_file}"
run "mysql -u #{dbuser} -p#{dbpass} -h #{production_dbhost} #{production_database} < #{backup_file}"
run "rm -f #{backup_file}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment