updated puma recipes

This commit is contained in:
Vokhmin Alexey V 2013-11-27 23:18:01 +04:00
parent fe6b9ee68f
commit c285b93f08
2 changed files with 8 additions and 31 deletions

View File

@ -7,6 +7,8 @@ workers ENV['PUMA_WORKERS'] || 5
pidfile File.join(base_path, 'shared', 'pids', 'unicorn.pid')
bind 'unix:///tmp/rosa_build_unicorn.sock'
preload_app!
on_worker_boot do
@ -21,4 +23,6 @@ on_worker_boot do
# Redis.connect!
# Rails.logger.info('Connected to Redis')
end
end
activate_control_app 'unix:///tmp/rosa_build_pumactl.sock'

View File

@ -1,31 +1,4 @@
# -*- encoding : utf-8 -*-
# Capistrano::Configuration.instance(:must_exist).load do
# namespace :deploy do
# # bundle exec puma -p $PORT -C config/puma.rb
# set :puma_binary, "bundle exec puma"
# set(:puma_pid) { "#{fetch :shared_path}/pids/unicorn.pid" }
# # set :unicorn_port, 8080
# task :start, :roles => :app, :except => { :no_release => true } do
# run "cd #{fetch :current_path} && #{try_sudo} #{puma_binary} -b unix:/tmp/#{fetch :application}_unicorn.sock -e #{rails_env} -d -C config/puma.rb" # -p #{unicorn_port}
# end
# task :stop, :roles => :app, :except => { :no_release => true } do
# run "#{try_sudo} kill `cat #{puma_pid}`" rescue warn 'deploy:stop FAILED'
# end
# task :graceful_stop, :roles => :app, :except => { :no_release => true } do
# run "#{try_sudo} kill -QUIT `cat #{puma_pid}`" rescue warn 'deploy:graceful_stop FAILED'
# end
# task :reload, :roles => :app, :except => { :no_release => true } do
# run "#{try_sudo} kill -USR2 `cat #{puma_pid}`" rescue warn 'deploy:reload FAILED'
# end
# task :restart, :roles => :app, :except => { :no_release => true } do
# reload
# #stop
# #start # blue pill will do it?
# end
# end
# end
Capistrano::Configuration.instance(:must_exist).load do
after 'deploy:stop', 'puma:stop'
after 'deploy:start', 'puma:start'
@ -34,8 +7,8 @@ Capistrano::Configuration.instance(:must_exist).load do
_cset(:puma_cmd) { "#{fetch(:bundle_cmd, 'bundle')} exec puma" }
_cset(:pumactl_cmd) { "#{fetch(:bundle_cmd, 'bundle')} exec pumactl" }
_cset(:puma_env) { fetch(:rack_env, fetch(:rails_env, 'production')) }
_cset(:puma_state) { "#{shared_path}/sockets/puma.state" }
_cset(:puma_socket) { "unix://tmp/#{fetch :application}_unicorn.sock" }
_cset(:puma_state) { "#{fetch :shared_path}/sockets/puma.state" }
_cset(:puma_socket) { "unix:/tmp/#{fetch :application}_unicorn.sock" }
_cset(:puma_role) { :app }
namespace :puma do
@ -70,7 +43,7 @@ Capistrano::Configuration.instance(:must_exist).load do
if config_file
"-q -d -e #{puma_env} -C #{config_file}"
else
"-q -d -e #{puma_env} -b '#{puma_socket}' -S #{state_path} --control 'unix://#{shared_path}/sockets/pumactl.sock'"
"-q -d -e #{puma_env} -b '#{puma_socket}' -S #{state_path} --control 'unix://#{fetch :shared_path}/sockets/pumactl.sock'"
end
end