1
0
Fork 0

Add Capistrano task "puma:stop"

This commit is contained in:
Alex Kotov 2018-12-09 09:24:08 +05:00
parent 5989d40d66
commit cd5224610b
No known key found for this signature in database
GPG Key ID: 4E831250F47DE154
4 changed files with 23 additions and 4 deletions

View File

@ -7,10 +7,6 @@ namespace :deploy do
desc 'Restart application services'
task :restart do
on roles(:web) do
execute :sudo, :systemctl, :restart, 'partynest-web.service'
end
on roles(:app) do
execute :sudo, :systemctl, :restart, 'partynest-worker.service'
end

View File

@ -33,3 +33,8 @@ port ENV.fetch('PORT') { 3000 }
# Allow puma to be restarted by `rails restart` command.
plugin :tmp_restart
# Use "path" as the file to store the server info state. This is
# used by "pumactl" to query and control the server.
#
state_path Rails.root.join('tmp', 'pids', 'puma.state')

View File

@ -33,3 +33,8 @@ bind "unix://#{Rails.root.join('tmp', 'sockets', 'puma.sock')}"
# Allow puma to be restarted by `rails restart` command.
# plugin :tmp_restart
# Use "path" as the file to store the server info state. This is
# used by "pumactl" to query and control the server.
#
state_path Rails.root.join('tmp', 'pids', 'puma.state')

View File

@ -0,0 +1,13 @@
# frozen_string_literal: true
namespace :puma do
desc 'Stop Puma web server'
task :stop do
on roles(:web) do
within release_path do
statefile = File.join shared_path, 'tmp', 'pids', 'puma.state'
execute :bundle, :exec, :pumactl, '--state', statefile, :stop
end
end
end
end