Created
September 4, 2010 11:53
-
-
Save seban/565132 to your computer and use it in GitHub Desktop.
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
load 'deploy' if respond_to?(:namespace) # cap2 differentiator | |
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } | |
load 'config/deploy' # remove this line to skip loading any of the default tasks | |
namespace :bundler do | |
task :create_symlink, :roles => :app do | |
shared_dir = File.join(shared_path, 'bundle') | |
release_dir = File.join(release_path, '.bundle') | |
run("mkdir -p #{shared_dir} && ln -s #{shared_dir} #{release_dir}") | |
end | |
task :install, :roles => :app do | |
run "cd #{release_path} && bundle install" | |
on_rollback do | |
if previous_release | |
run "cd #{previous_release} && bundle install" | |
else | |
logger.important "no previous release to rollback to, rollback of bundler:install skipped" | |
end | |
end | |
end | |
task :bundle_new_release, :roles => :db do | |
bundler.create_symlink | |
bundler.install | |
end | |
end | |
namespace :deploy do | |
desc "Restart app with Megiteam script" | |
task :restart, :role => :app do | |
run "restart-app #{ application }" | |
end | |
end | |
after "deploy:rollback:revision", "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