Skip to content

Reload Unicorn and Sidekiq after deployment #533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,20 @@
# Default value for keep_releases is 5
# set :keep_releases, 5

namespace :deploy do
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
# within release_path do
# execute :rake, 'cache:clear'
# end
namespace :unicorn do
desc 'reload Unicorn'
task :reload do
on roles(:app) do
execute "sudo systemctl reload timeoverflow"
end
end
end

namespace :sidekiq do
desc 'reload Sidekiq'
task :restart do
on roles(:app) do
execute "sudo systemctl restart sidekiq"
end
end
end
Expand All @@ -67,4 +74,8 @@
end
end
end

before "deploy:migrate", "deploy:db:load" if ENV["COLD"]

after "deploy:finishing", "unicorn:reload"
after "deploy:finishing", "sidekiq:restart"