Skip to content

Instantly share code, notes, and snippets.

@crhan
Created December 19, 2013 09:40
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 crhan/8036764 to your computer and use it in GitHub Desktop.
Save crhan/8036764 to your computer and use it in GitHub Desktop.
make capistrano deploy code in a limited parallel
namespace :deploy do
## set max_hosts 20 or via env
set :max_hosts, ENV['MAXHOSTS'] || 20
## set max_hosts on update_code
task :update_code, :except => { :no_release => true }, :max_hosts => "#{max_hosts}" do
logger.info "\e[0;31;1mNOTICE:\e[0m Pulling repo from #{repository}: max_hosts => '#{max_hosts}'"
on_rollback { run "rm -rf #{release_path}; true" }
strategy.deploy!
finalize_update
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment