I’m working on a Phoenix app, but my question is more related to Elixir v1.9 releases. I’ve setup Ansible playbook which builds a release using
mix release and uploads it to a production server. So at the time of a deployment, there are actually two releases on the server:
- A current one which is up and running.
- A new one, which has been deployed with Ansible and is not running yet.
What I do is finding a currently running release and using
stop command on it. But I feel like there should be a better way to gracefully “replace” an old release with a new one, so that there is a little downtime during restart. For example, in my case I need to run migrations for the new release, which may take a while.
Do you have any ideas on how to handle it? Thanks!