-
-
Save logankoester/541872 to your computer and use it in GitHub Desktop.
Bundler integration for Capistrano
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
namespace :bundler do | |
task :install, :roles => :app, :except => { :no_release => true } do | |
run("gem install bundler --source=http://rubygems.org") | |
end | |
task :create_symlink, :roles => :app do | |
shared_dir = File.join(shared_path, 'bundle') | |
release_dir = File.join(current_release, '.bundle') | |
run("mkdir -p #{shared_dir} && ln -fs #{shared_dir} #{release_dir}") | |
end | |
task :bundle_new_release, :roles => :app do | |
bundler.create_symlink | |
run "cd #{release_path} && bundle install --without test" | |
end | |
task :lock, :roles => :app do | |
run "cd #{current_release} && bundle lock;" | |
end | |
task :unlock, :roles => :app do | |
run "cd #{current_release} && bundle unlock;" | |
end | |
end | |
after "deploy:setup", "bundler:install" | |
after "deploy:update_code", "bundler:bundle_new_release" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment