Add Capistrano task "puma:stop"
This commit is contained in:
parent
5989d40d66
commit
cd5224610b
4 changed files with 23 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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')
|
||||
|
|
13
lib/capistrano/tasks/puma.rake
Normal file
13
lib/capistrano/tasks/puma.rake
Normal 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
|
Reference in a new issue