Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Commit

Permalink
deploy: update shared configs after deploy:stop, before deploy:start
Browse files Browse the repository at this point in the history
  • Loading branch information
dazza-codes committed Jul 20, 2017
1 parent 7992623 commit 3a2fc85
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,35 @@
# http://vladigleba.com/blog/2014/04/10/deploying-rails-apps-part-6-writing-capistrano-tasks/
desc 'Restart application'
task :restart do
invoke 'deploy:stop'
invoke 'shared_configs:update'
invoke 'deploy:start'
end
# Capistrano 3 no longer runs deploy:restart by default.
after :publishing, :restart

desc 'Start the robots'
task :start do
on roles(:app), in: :sequence, wait: 10 do
within release_path do
test :bundle, :exec, :controller, :stop
test :bundle, :exec, :controller, :quit
execute :bundle, :exec, :controller, :boot
end
end
end
# Capistrano 3 no longer runs deploy:restart by default.
after :publishing, :restart

desc 'Stop the robots'
task :stop do
on roles(:app), in: :sequence, wait: 10 do
within release_path do
execute :bundle, :exec, :controller, :stop
execute :bundle, :exec, :controller, :quit
end
end
end
end

set :honeybadger_env, fetch(:stage)

# update shared_configs before restarting app
before 'deploy:restart', 'shared_configs:update'

# capistrano next reads config/deploy/#{server}.rb, where #{server} is the first argument to cap; e.g.:
# cap localhost deploy:check # invokes config/deploy/localhost.rb
# cap test1 deploy:check # invokes config/deploy/test1.rb
Expand Down

0 comments on commit 3a2fc85

Please sign in to comment.