bitwalker / distillery

Simplify deployments in Elixir with OTP releases!
MIT License
2.96k stars 396 forks source link

mix distillery.release give :eacces error #748

Closed shivam-tripathi closed 1 year ago

shivam-tripathi commented 1 year ago

Steps to reproduce

I was following the guide: https://hexdocs.pm/distillery/introduction/installation.html

Add deps

{:distillery, "~> 2.1"}
mix distillery.release

Verbose Logs

Verbose: https://gist.github.com/shivam-tripathi/a85a4431d9a943002b963a867413351a Short:

==> Release failed: no match of right hand side value: {:error, :eacces}
    (distillery 2.1.1) lib/distillery/releases/assembler.ex:865: Distillery.Releases.Assembler.create_RELEASES/2
    (distillery 2.1.1) lib/distillery/releases/assembler.ex:290: Distillery.Releases.Assembler.write_release_scripts/1
    (distillery 2.1.1) lib/distillery/releases/assembler.ex:50: Distillery.Releases.Assembler.assemble/1
    (distillery 2.1.1) lib/distillery/tasks/release.ex:130: Mix.Tasks.Distillery.Release.do_release/2
    (mix 1.13.4) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.13.4) lib/mix/cli.ex:84: Mix.CLI.run_task/2
    (elixir 1.13.4) src/elixir_compiler.erl:73: :elixir_compiler.dispatch/4
    (elixir 1.13.4) src/elixir_compiler.erl:58: :elixir_compiler.compile/3

Description of issue

I am getting :eacces error when I trigger mix distillery.release - at line number lib/distillery/releases/assembler.ex:863. Because of this I am not able to create a release using distillary. I updated config.ex using {:distillery, "~> 2.1", path: 'deps/distillery'}, and updated deps/distillery/releases/assembler.ex with values:

Shell.debug("Generating RELEASES #{old_cwd} #{output_dir} #{relfile}")

It prints the following:

==> Generating RELEASES /Users/st/myapp _build/dev/rel/myapp /Users/st/myapp/_build/dev/rel/myapp/releases/0.1.0/myapp.rel

I checked if the _build has write permission issues:

if [ -w "./_build" ]; then echo "WRITABLE"; else echo "NOT WRITABLE"; fi

This prints WRITABLE.

shivam-tripathi commented 1 year ago

Looks like a duplicate of https://github.com/bitwalker/distillery/issues/744#issuecomment-1279436355 Making the change suggested in the code fixed the issue on local. It would be great if we can fix the issue in the library itself, it'll help with CI/CD.