1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
| set :solid_queue_systemd_unit_name, "solid_queue.service"
namespace :solid_queue do
desc "Quiet solid_queue (start graceful termination)"
task :quiet do
on roles(:app) do
execute :systemctl, "--user", "kill", "-s", "SIGTERM", fetch(:solid_queue_systemd_unit_name), raise_on_non_zero_exit: false
end
end
desc "Stop solid_queue (force immediate termination)"
task :stop do
on roles(:app) do
execute :systemctl, "--user", "kill", "-s", "SIGQUIT", fetch(:solid_queue_systemd_unit_name), raise_on_non_zero_exit: false
end
end
desc "Start solid_queue"
task :start do
on roles(:app) do
execute :systemctl, "--user", "start", fetch(:solid_queue_systemd_unit_name)
end
end
desc "Restart solid_queue"
task :restart do
on roles(:app) do
execute :systemctl, "--user", "restart", fetch(:solid_queue_systemd_unit_name)
end
end
end
# SolidQueue hooks
after "deploy:starting", "solid_queue:quiet"
after "deploy:updated", "solid_queue:stop"
after "deploy:published", "solid_queue:start"
after "deploy:failed", "solid_queue:restart"
|