Created
July 3, 2013 16:29
-
-
Save codeprimate/5920154 to your computer and use it in GitHub Desktop.
Rolling deploy task for Capistrano.
This file contains hidden or 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
#... | |
set :rolling_deploy_wait, 60 | |
# Rolling restart of application servers | |
task :restart, :roles => [:app], :except => {:no_release => true}, :once => true do | |
servers = find_servers_for_task(current_task) | |
servers.each_with_index do |s, index| | |
run "sleep #{index * rolling_deploy_wait}; \ | |
touch #{File.join(current_path,'tmp','restart.txt')}; \ | |
nohup curl localhost > /dev/null 2>&1 &", | |
:hosts => s.host | |
end | |
end | |
#... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment