2020-02-26 15:22:34 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-02-26 15:28:48 +00:00
|
|
|
namespace :pumx do
|
2020-02-26 15:22:34 +00:00
|
|
|
desc 'Start puma'
|
|
|
|
task :start do
|
|
|
|
on roles(:web) do
|
|
|
|
within current_path do
|
|
|
|
execute :bundle, :exec, :puma, '--daemon'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
desc 'Stop puma'
|
|
|
|
task :stop do
|
|
|
|
on roles(:web) do
|
|
|
|
within current_path do
|
2020-02-26 15:28:48 +00:00
|
|
|
pid = "#{current_path}/tmp/pids/puma.pid"
|
2020-02-26 15:37:04 +00:00
|
|
|
execute "test -f '#{pid}' && cat '#{pid}' | xargs kill ; :"
|
2020-02-26 15:22:34 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|