Skip to content

Instantly share code, notes, and snippets.

@johanlunds
Created July 31, 2010 23:15
Show Gist options
  • Save johanlunds/502730 to your computer and use it in GitHub Desktop.
Save johanlunds/502730 to your computer and use it in GitHub Desktop.
namespace :bundler do
task :create_symlink, :roles => :app do
bundle_dir = "#{release_path}/vendor/bundle"
shared_dir = "#{shared_path}/bundle"
run "rm -rf #{bundle_dir}"
run "mkdir -p #{shared_dir} && ln -s #{shared_dir} #{bundle_dir}"
end
task :bundle_new_release, :roles => :app do
bundler.create_symlink
run "cd #{release_path} && bundle install --production --without development test"
end
end
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