Is there any way to roll back an elixir mix release?

I haven’t found any mention of rolling back / reverting in the elixir mix docs or googling. I can’t imagine I’m the only one who would want to do that. Is there any tooling to make this easier?

It’s not really hard to have a scripted green/red deployment pipeline with an ability to rollback:

# update
mix release --path ./v2
./v1/bin/my_app stop
./v2/bin/my_app start

# rollback
./v2/bin/my_app stop
./v1/bin/my_app start

It’s a matter of versioning your deployments.
Symlinks e.g. to current_release could also help to generalize the pipeline.

But of course that’s only one strategy.

You can switch versions, s. Switching versions of released app breaks after updates - there is an env variable you can set to activate a previously released version, it’s documented (a little). Upgrading runtime seems to break the old versions though, at least in my case.

1 Like