vfsoraki

vfsoraki

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:

DEPLOYING UPGRADE OF BACKEND_PLATFORM APP TO PRODUCTION HOSTS

-----> 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:

user@prod-1

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,
“/var/user/api/backend_platform/releases/0.0.2+37-e582b43/relup”}

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.

Marked As Solved

vfsoraki

vfsoraki

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.

Where Next?

Popular in Questions Top

vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
gonzofish
I’m currently trying to understand how to join three tables using Ecto. All the examples I’ve seen use 2, so maybe I’m just missing somet...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
Exadra37
Sometimes I want to check if the input into a function is not a blank string. My first approach: defmodule Example do def do_stuff(s...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

Other popular topics Top

pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

We're in Beta

About us Mission Statement