Created
October 19, 2013 21:12
-
-
Save robinboening/7061638 to your computer and use it in GitHub Desktop.
Capistrano and rake tasks to sync database, picture and attachment data of alchemy_cms between i.e. staging and production systems.
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
# Example usage: | |
# cap staging sync_with:production | |
# File: config/deploy/staging.rb | |
namespace :sync_with do | |
desc "Sync with production system." | |
task :production do | |
run "cd #{current_path} && RAILS_ENV=#{rails_env} #{rake} sync_with:production" | |
end | |
end | |
# File: lib/tasks/sync.rake | |
namespace :sync_with do | |
desc "Populates the current server with production server data." | |
task :production => [:environment] do | |
system "bundle exec cap production alchemy:import:all" | |
Rails.cache.clear # clean the complete cache, so the new data will appear. | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment