1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Merge pull request #282 from bai/configurable-socket

Allow listening socket to be configured via Capistrano variable
This commit is contained in:
Evan Phoenix 2013-06-17 22:49:45 -07:00
commit 3474bcbc1c

View file

@ -11,13 +11,14 @@ Capistrano::Configuration.instance.load do
_cset(:puma_cmd) { "#{fetch(:bundle_cmd, 'bundle')} exec puma" }
_cset(:pumactl_cmd) { "#{fetch(:bundle_cmd, 'bundle')} exec pumactl" }
_cset(:puma_state) { "#{shared_path}/sockets/puma.state" }
_cset(:puma_socket) { "unix://#{shared_path}/sockets/puma.sock" }
_cset(:puma_role) { :app }
namespace :puma do
desc 'Start puma'
task :start, :roles => lambda { fetch(:puma_role) }, :on_no_matching_servers => :continue do
puma_env = fetch(:rack_env, fetch(:rails_env, 'production'))
run "cd #{current_path} && #{fetch(:puma_cmd)} -q -d -e #{puma_env} -b 'unix://#{shared_path}/sockets/puma.sock' -S #{fetch(:puma_state)} --control 'unix://#{shared_path}/sockets/pumactl.sock'", :pty => false
run "cd #{current_path} && #{fetch(:puma_cmd)} -q -d -e #{puma_env} -b '#{fetch(:puma_socket)}' -S #{fetch(:puma_state)} --control 'unix://#{shared_path}/sockets/pumactl.sock'", :pty => false
end
desc 'Stop puma'