public
Last active — forked from richievos/bundler_cap.rb

  • Download Gist
bundler_cap.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
namespace :bundler do
task :install do
run("#{sudo} gem install bundler --source=http://gemcutter.org")
end
 
task :symlink_vendor do
shared_gems = File.join(shared_path, 'vendor/gems')
release_gems = "#{release_path}/vendor/gems/"
%w(cache gems specifications).each do |sub_dir|
shared_sub_dir = File.join(shared_gems, sub_dir)
run("mkdir -p #{shared_sub_dir} && mkdir -p #{release_gems} && ln -s #{shared_sub_dir} #{release_gems}/#{sub_dir}")
end
end
 
task :bundle_new_release do
bundler.symlink_vendor
# Only use cached gems when expanding the bundle
run("cd #{release_path} && #{gem_ex} bundle --only #{rails_env} --cached")
end
end
 
after 'deploy:update_code', 'bundler:bundle_new_release'

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.