Skip to content

Commit fad9dbd

Browse files
committed
Reload Unicorn and Sidekiq after deployment
So we can remove the following manual step from the deployment process: > There is one last step though. Until we don't fix it, the app server needs to be restarted manually for the changes to be loaded. Run: > $ ssh timeoverflow@www.timeoverflow.org > $ sudo systemctl restart timeoverflow > $ sudo systemctl restart sidekiq
1 parent 58e42a4 commit fad9dbd

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

config/deploy.rb

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,20 @@
4747
# Default value for keep_releases is 5
4848
# set :keep_releases, 5
4949

50-
namespace :deploy do
51-
after :restart, :clear_cache do
52-
on roles(:web), in: :groups, limit: 3, wait: 10 do
53-
# Here we can do anything such as:
54-
# within release_path do
55-
# execute :rake, 'cache:clear'
56-
# end
50+
namespace :unicorn do
51+
desc 'reload Unicorn'
52+
task :reload do
53+
on roles(:app) do
54+
execute "sudo systemctl reload timeoverflow"
55+
end
56+
end
57+
end
58+
59+
namespace :sidekiq do
60+
desc 'reload Sidekiq'
61+
task :restart do
62+
on roles(:app) do
63+
execute "sudo systemctl restart sidekiq"
5764
end
5865
end
5966
end
@@ -67,4 +74,8 @@
6774
end
6875
end
6976
end
77+
7078
before "deploy:migrate", "deploy:db:load" if ENV["COLD"]
79+
80+
after "deploy:finishing", "unicorn:reload"
81+
after "deploy:finishing", "sidekiq:restart"

0 commit comments

Comments
 (0)