Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distillery support broke with changed output_dir in distillery 1.0.0 #182

Closed
arnodirlam opened this issue Dec 27, 2016 · 5 comments · Fixed by #256
Closed

distillery support broke with changed output_dir in distillery 1.0.0 #182

arnodirlam opened this issue Dec 27, 2016 · 5 comments · Fixed by #256
Labels

Comments

@arnodirlam
Copy link

Since distillery 1.0.0, its output_dir is configurable, and the default has changed, causing edeliver 1.4.0 to not work anymore out of the box.

I've fixed it by configuring distillery to use the old output_dir like so:

  # set output_dir for edeliver
  name = "vira"  # CHANGE ME
  output_dir = Path.relative_to_cwd(Path.join(["rel", "#{name}"]))
  IO.puts "Distillery output_dir: #{output_dir}"
  set output_dir: output_dir

I've spent several hours trying to understand is executed where (edeliver vs. distillery, local vs. build server vs. deploy server) and what paths are used, before I gave up and changed the output_dir in distillery.

Would it be possible to accomodate the changed distillery default in the next version of edeliver?

Environment

  • Edeliver version (mix edeliver --version): 1.4.0
  • Elixir version (elixir -v): 1.3.4
  • Build tool and version (distillery|exrm): distillery 1.0.0
  • Operating system (on build / deploy hosts): Ubuntu 16.04 (local, build, deploy)
  • Are you using an umbrella project (yes|no): no

Verbose output

==> Upgrading vira from 0.0.1+33-8102783 to 0.0.1+34-708e701
==> Upgrade from 0.0.1+33-8102783 to 0.0.1+34-708e701 failed:
  0.0.1+33-8102783 does not exist at _build/prod/rel/vira/releases/0.0.1+33-8102783
==> Failed to build release:
    :bad_upgrade_spec

A remote command failed on:

  root@api.askvira.com

Output of the command is shown above and the command executed
on that host is printed below for debugging purposes:

FAILED with exit status 1:

    [ -f ~/.profile ] && source ~/.profile
    set -e
    cd /tmp/edeliver/vira/builds
    if [ "mix" = "rebar" ]; then
      echo "using rebar to generate release"
      ./rebar   -f generate
    elif [ "mix" = "relx" ]; then
      echo "using relx to generate release"
      ./relx release
    elif [ "mix" = "mix" ]; then
      echo "using mix to generate release"
      MIX_ENV="prod" LINK_SYS_CONFIG="" LINK_VM_ARGS="" APP="vira" AUTO_VERSION="commit-count+git-revision+branch-unless-master" BRANCH="master" SKIP_RELUP_MODIFICATIONS="" RELUP_MODIFICATION_MODULE="" USING_DISTILLERY="true" mix do release.version  --verbose,  release --verbose --env="prod" --name="vira" --upgrade --upfrom="0.0.1+33-8102783"
    fi

Current behavior

edeliver cannot find distillery release, because distillery output_dir default has changed with distillery 1.0.0

Expected behavior

edeliver should find distillery release without further configuration when using distillery 1.0.0.

@green-arrow
Copy link

green-arrow commented Dec 29, 2016

For anyone else reading this issue, the temporary fix is to go into rel/config.exs and add the following:

# Other environments

environment :prod do
  # Other settings
  set output_dir: "rel/<your_app_name>"
end

@alex-kovshovik
Copy link

@green-arrow's workaround works, I finally got edeliver to do hot code upgrades.

Found too many gotchas in the whole process besides this one. For example:

  • the "APP" variable must match the release name in the rel/config.exs and it must match the name of the app in mix.exs. If not - the mix edeliver start production would just hang and then fail without clear error message.
  • if you stop the mix edeliver task in the middle - sometimes you cannot start over without having to delete the contents of _build directory.

@rmarscher
Copy link

I had an umbrella app that needed set output_dir: "apps/<app_name>/rel/<app_name>"

@lessless lessless added the bug label Feb 3, 2018
@lessless
Copy link
Member

lessless commented Feb 9, 2018

@green-arrow @rmarscher thanks for the input guys!

The error is happening mix release task, which is not a part of edeliver. I'm looking into it and will try to come up with the patch.

@lessless lessless added wontfix and removed bug labels Feb 9, 2018
@lessless lessless closed this as completed Feb 9, 2018
@lessless
Copy link
Member

lessless commented Feb 9, 2018

Sorry people, I misread it. Patch is ready and tested #256
Can you please try it out and comment if it works in your environment?

Here is the mix.conf dependency setting

{:edeliver, github: "edeliver/edeliver", branch: "bugs/update-default-distillery-release-folder"},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants