lumi-api/lib/capistrano/tasks/pumx.rake

23 lines
441 B
Ruby
Raw Normal View History

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"
execute "test -f '#{pid}' && cat '#{pid}' | xargs kill"
2020-02-26 15:22:34 +00:00
end
end
end
end