5
我Capistrano的配置來對跨三臺物理服務器部署。我想配置重啓任務,以順序進入每臺服務器並重啓應用程序,而不是一次轉到所有服務器的默認方式。Capistrano的順序重新啓動
這是當前部署任務:
namespace :deploy do
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && bundle exec unicorn_rails -C#{current_path}/config/unicorn.rb -E #{rails_env} -D"
end
task :stop, :roles => :app, :except => { :no_release => true } do
run "kill `cat #{current_path}/tmp/pids/unicorn.pid`"
end
task :restart, :roles => :app, :except => { :no_release => true } do
stop
sleep(10)
start
end
end
我想是這樣的:
#this does not work
task :sequential_restart do
find_servers(:roles => :app).each
restart
end
end
什麼想法?