Skip to content

Instantly share code, notes, and snippets.

@ctrochalakis
Created July 28, 2010 06:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctrochalakis/493586 to your computer and use it in GitHub Desktop.
Save ctrochalakis/493586 to your computer and use it in GitHub Desktop.
Bundler rc capistrano recipe
# Bundler-rc deploy recipe
namespace :bundler do
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 -s #{shared_dir} #{release_dir}")
end
desc "Install gem bundle if needed"
task :install, :roles => :app do
bundler.create_symlink
bundle_path ="#{shared_path}/bundler"
run "cd #{release_path} && ( bundle check || bundle install #{bundle_path} --disable-shared-gems )"
end
end
after 'deploy:update_code', 'bundler:install'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment