Created
November 5, 2012 10:02
-
-
Save schnittchen/4016423 to your computer and use it in GitHub Desktop.
Using backup gem in rails project with separate Gemfile
This file contains hidden or 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
Note: the full file names are config/backup/Gemfile and config/deploy.rb, which gist.github.com can't handle ;-) | |
Of course, you will need a backup config file, preferrably in config/backup/config.rb, and you need to trigger the backup from cron (check out the whenever gem if you want that behaviour bundled with your rails app). | |
In both files, you need to take the locations of stuff (rails root, backup config file) into consideration. |
This file contains hidden or 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
source 'http://rubygems.org' | |
# your exact requirements depend on the way you use backup and the version of the backup gem. | |
# Be sure to have a look at https://github.com/meskyanichi/backup/blob/master/lib/backup/dependency.rb | |
# at the relevant version! | |
gem 'backup', '3.0.24' | |
gem 'fog', '~> 1.1.0' | |
gem 'mail', '~> 2.4.0' |
This file contains hidden or 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
... | |
after "deploy:update_code", "deploy:bundle_for_backup" | |
namespace :deploy do | |
task(:bundle_for_backup) do | |
run "cd #{release_path}/config/backup && bundle install --quiet --deployment" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment