summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2010-08-10 18:38:04 -0700
committerAndre Arko <andre@arko.net>2010-08-10 18:38:13 -0700
commit62d9fc9d9ce3c5a0933c6091e3eb3d8530908d5f (patch)
treedca727b5b01058f0345410f046d49ce1cab8ca15
parentbfdea45838fdf68462c055e9cfc6076abddd3d71 (diff)
downloadbundler-62d9fc9d9ce3c5a0933c6091e3eb3d8530908d5f.tar.gz
Update cap task
-rw-r--r--lib/bundler/capistrano.rb22
1 files changed, 7 insertions, 15 deletions
diff --git a/lib/bundler/capistrano.rb b/lib/bundler/capistrano.rb
index 9d94745ba3..f04a55a70d 100644
--- a/lib/bundler/capistrano.rb
+++ b/lib/bundler/capistrano.rb
@@ -1,23 +1,15 @@
# Capistrano task for Bundler.
#
-# Just add "require 'bundler/capistrano'" in your Capistrano deploy file (deploy.rb).
-# Bundler will be activated after each new deployment.
+# Just add "require 'bundler/capistrano'" in your Capistrano deploy.rb, and Bundler
+# will be activated after each new deployment. To configure the directory that
+# Bundler will install to, set :bundle_dir before deploy:update_code runs.
Capistrano::Configuration.instance(:must_exist).load do
- after "deploy:update_code", "bundler:bundle_new_release"
+ after "deploy:update_code", "bundle:install"
- namespace :bundler do
- task :create_symlink, :roles => :app do
- set :bundle_dir, File.join(release_path, 'vendor', 'bundle')
-
- shared_dir = File.join(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 --deployment --without development test"
+ namespace :bundle do
+ task :install do
+ run "bundle install --gemfile #{release_path}/Gemfile --path #{fetch(:bundle_dir, '#{shared_path}/bundle')} --deployment --without development test"
end
end
end