Build and deploy upgrades with edeliver

I am trying to do upgrades with edeliver (and distillery), but I don’t know why it does not work.

I use commit-count-all+branch-unless-master+git-revision for versioning.

First, I build a release with mix edeliver build release and I can find the release in .deliver/releases.

Then I deploy it with mix edeliver deploy release to production, and it asks to deploy what version. I select the last version. It deploys and app is running.

Two commits later, I want to upgrade it. As I get it, an upgrade has to be built using mix edeliver build upgrade --with=<release-version>. It does not work. The error log says (last lines):

==> Upgrading backend_platform from 0.0.2+37-e582b43 to 0.0.3+39-bdf911a
==> Upgrade failed, version 0.0.2+37-e582b43 does not exist:
expected at: _build/prod/rel/backend_platform/releases/0.0.2+37-e582b43

It should copy the release and build upgrade from it, but it seems like it does not do it. Or maybe I’m doing it wrong.

Next try it to upgrade from git commit, like mix edeliver build upgrade --from=e582b43 and it creates the upgrades in release store.

Now, to deploy upgrade I run mix edeliver deploy upgrade to production and here is the error:


-----> Authorizing hosts
-----> Uploading archive of release 0.0.3+39-bdf911a from local release store
-----> Upgrading release to 0.0.3+39-bdf911a

A remote command failed on:


Output of the command is shown above if the --verbose option
was used and the commands executed on that remote host are
printed below for debugging purposes:

FAILED with exit status 3:

ssh -o ConnectTimeout=60 adtube@prod-1
[ -f ~/.profile ] && source ~/.profile
set -e
cd /var/user/api/backend_platform &> /dev/null
bin/backend_platform upgrade 0.0.3+39-bdf911a &> /dev/null
&> /dev/null

Anyway, the release folder exists on production, trying bin/backend_platform upgrade 0.0.3+39-bdf911a on production hosts yields this error:

Release 0.0.3+39-bdf911a is already unpacked
Release 0.0.3+39-bdf911a is already unpacked, now installing.
ERROR: release_handler:check_install_release failed: {enoent,

Why is it searching for the release relup file? The upgrade contains relup file, but I don’t get why release would need it.

I also tried mix edeliver upgrade production, and result it the same as if I run mix edeliver build upgrade --with=<release>.

Anything I’m doing wrong?

PS. Package version:

 {:edeliver, "~> 1.4.3"},
 {:distillery, "~> 1.4", runtime: false},

PS2. Elixir is 1.5.0 and Erlang is 20.

I found the issue. I don’t know why it does not show up while searching for edeliver upgrade fails.

Anyway, the issue is with latest updates of distillery. Related issue.

PS. Related blog post.

1 Like