Files
grecia/lib/capistrano/tasks/restart.cap
Javi Martín 94a7e13dce Update capistrano's restart unicorn task
Our current unicorn task wasn't working in some cases. We also had a
version in the `capistrano` branch, which was the one we recommended.
However, that version assumed RVM, a certain ruby version and a certain
deploy folder were used. This version uses `bundle exec` and variables
like `release_path`, so it does not depend on any specific
configuration.

Even if we're replacing unicorn with puma, I wanted to make this change
in case we need it as a reference in the future.
2019-10-10 21:01:42 +02:00

12 lines
416 B
Plaintext

namespace :deploy do
desc "Restart Unicorn"
task :restart do
on roles(:app) do
execute "kill -QUIT `cat #{deploy_to}/pids/unicorn.pid`; true"
execute "kill -QUIT `cat #{shared_path}/pids/unicorn.pid`; true"
execute "kill -QUIT `cat #{shared_path}/tmp/pids/unicorn.pid`; true"
execute "cd #{release_path} && bundle exec unicorn -c config/unicorn.rb -E production -D"
end
end
end