2012-10-15 23:08:19 -04:00
|
|
|
Capistrano::Configuration.instance.load do
|
|
|
|
after "deploy:stop", "puma:stop"
|
|
|
|
after "deploy:start", "puma:start"
|
|
|
|
after "deploy:restart", "puma:restart"
|
|
|
|
|
|
|
|
_cset(:puma_role) { :app }
|
|
|
|
|
|
|
|
namespace :puma do
|
|
|
|
desc "Start puma"
|
|
|
|
task :start, :roles => lambda { fetch(:puma_role) }, :on_no_matching_servers => :continue do
|
2012-10-16 00:07:17 -04:00
|
|
|
puma_env = fetch(:stage, "production")
|
2012-10-16 08:21:49 -04:00
|
|
|
run "cd #{current_path} && #{fetch(:bundle_cmd, "bundle")} exec puma -d -e #{puma_env} -b 'unix://#{shared_path}/sockets/puma.sock' -S #{shared_path}/sockets/puma.state --control 'unix://#{shared_path}/sockets/pumactl.sock'", :pty => false
|
2012-10-15 23:08:19 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
desc "Stop puma"
|
|
|
|
task :stop, :roles => lambda { fetch(:puma_role) }, :on_no_matching_servers => :continue do
|
2012-10-16 00:47:34 -04:00
|
|
|
run "cd #{current_path} && #{fetch(:bundle_cmd, "bundle")} exec pumactl -S #{shared_path}/sockets/puma.state stop"
|
2012-10-15 23:08:19 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
desc "Restart puma"
|
|
|
|
task :restart, :roles => lambda { fetch(:puma_role) }, :on_no_matching_servers => :continue do
|
2012-10-16 00:47:34 -04:00
|
|
|
run "cd #{current_path} && #{fetch(:bundle_cmd, "bundle")} exec pumactl -S #{shared_path}/sockets/puma.state restart"
|
2012-10-15 23:08:19 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|