Remove task to stop the puma daemon

This task was necessary when updating to version 2.1.0, when we
integrated Puma with Systemd. Now that all Consul Democracy
installations are using Systemd, we no longer need it.
This commit is contained in:
Javi Martín
2024-04-02 23:35:45 +02:00
parent b520cb8f24
commit 02b1725eaf

View File

@@ -69,7 +69,6 @@ namespace :deploy do
after "deploy:migrate", "add_new_settings"
after :publishing, "setup_puma"
before "puma:smart_restart", "stop_puma_daemon"
after :finished, "refresh_sitemap"
desc "Deploys and runs the tasks needed to upgrade to a new release"
@@ -178,20 +177,3 @@ task :setup_puma do
after "setup_puma", "puma:systemd:config"
after "setup_puma", "puma:systemd:enable"
end
# Code adapted from the task to stop the daemon in capistrano3-puma
desc "Stops the Puma daemon so systemd can start the Puma process"
task :stop_puma_daemon do
on roles(fetch(:puma_role)) do |role|
within release_path do
with rails_env: fetch(:rails_env) do
if test("[ -f #{fetch(:puma_pid)} ]") &&
!test("systemctl --user is-active #{fetch(:puma_service_unit_name)}") &&
test(:kill, "-0 $( cat #{fetch(:puma_pid)} )")
info "Puma: stopping daemon"
execute :pumactl, "-S #{fetch(:puma_state)} -F #{fetch(:puma_conf)} stop"
end
end
end
end
end