2
votes

I have an elixir application with 3 umbrella projects. I am trying to automate their releases via distellary and edeliver.

I am able to create a release by running this command:

mix release --verbose --env="production" --name="se_example"

However when I run the following: mix edeliver build release production --verbose

It compiles the app but later throws this error when creating release:

-----> Generating release using mix to generate release

** (Mix) The task "release" could not be found

I am new to elixir and distillery / edeliver world so was wondering if I am missing something in this flow.

Following is my .deliver/config file:

PRODUCTION_HOSTS="elixir-build"
PRODUCTION_USER="meraj"
DELIVER_TO="/home/meraj/se_example_build"

# For *Phoenix* projects, symlink prod.secret.exs to our tmp source
pre_erlang_get_and_update_deps() {
  local _prod_secret_path="/home/meraj/se_example_build/prod.secret.exs"
  if [ "$TARGET_MIX_ENV" = "prod" ]; then
    __sync_remote "
      ln -sfn '$_prod_secret_path' '$BUILD_AT/config/prod.secret.exs'
      ln -sfn '$_prod_secret_path' '$BUILD_AT/apps/se/config/prod.secret.exs'
    "
  fi
}

And here is rel/config.exs file:

Path.join(["rel", "plugins", "*.exs"])
|> Path.wildcard()
|> Enum.map(&Code.eval_file(&1))

use Mix.Releases.Config,
    default_release: :default,
    default_environment: Mix.env()

environment :dev do
  set dev_mode: true
  set include_erts: false
  set cookie: :"P@/3]_>gLBMM9c@&aRUg>lkN)<q6Z$0`ZM_/./!8N_/*1Fx:toH9n~I5_=O&=>$:"
end

environment :prod do
  set include_erts: true
  set include_src: false
  set cookie: :"BD:?3o^s?_Yn4SV%s.;@A>Sva*A}s5NbEC[&.qBMhA.*6^?ElspFmoF%GKX]:[En"
end

release :se_example do
  set version: "0.1.0"
  set applications: [
    :runtime_tools,
    se: :permanent,
    se_stats: :permanent,
    se_web: :permanent
  ]
end
1
It sounds like you do not have distillery installed. Can you show your dependencies as listed in your mix.exs file?Justin Wood
Following is my mix.exs: defmodule Se.Example.Mixfile do use Mix.Project def project do [ apps_path: "apps", start_permanent: Mix.env == :prod, deps: deps() ] end defp deps do [ {:distillery, "~> 1.5.2"}, {:edeliver, "~> 1.4.6"} ] end end Meraj Rasool
Did you actually run mix deps.get after adding distillery as a dependency?Justin Wood
Yes. I have run. To made sure, I re-run it and tried again but with same result.Meraj Rasool
@MerajRasool did you find a solution?Caleb_Allen

1 Answers

1
votes

I had same error and found solution (at least in my situation), answered in another related topic here - https://stackoverflow.com/a/53950284/6371774

TLDR: point your branch explicitly and make sure, that folder /rel/ under git and committed:

$ mix edeliver build release --branch=feature/deploy