Include capistrano tasks that reload the services after deploying. #12642
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After a successfull deploy, I need the services to switch over to use the
new code. I need to (re)start the services. Also, often, I need to inspect whether the services are running or why they crashed.
The capistrano tasks in this PR do that.
I'm not certain whether this is useful to mastodon at all.
Please let me know what you think about this PR. Is it useful to Mastodon? Would it be useful if I make some changes? Or should it simply be closed?
It might be more appropriate in the specific environment-deploy files for example:
config/deploy/production.rb
. Otherwise, I probably need to add documentation (but where?) and a PR in the ansible-repo to set this up properly.On my server, using ansible, I configure the deploy user to be allowed to restart services. Without such a configuration, the deploy will fail with this setup.
EDIT: additional detail, is that it depends on the service and its setup whether it can be reloaded. I have set up my units on my server such that they can be reloaded but with the service-examples in
/dist
of this repo, for example, Sidekiq cannot be reloaded, only restarted.