bitwalker / distillery

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

mix release.init --name does not set release name #644

Closed farao closed 5 years ago

farao commented 5 years ago

On my server, I am deploying different branches of the same elixir projects with mix. I understand now, that they are not supposed to have the same release name because if they do, there is some kind of name clash and only one of them runs properly. I found the --name option of mix release.init and thought that this might be the solution to my problem. But it doesn't seem to work as expected - when I execute: mix release.init --name PROJECTNAME_BRANCHNAME, I would expect the rel/config.exs to include at the bottom: release :PROJECTNAME_BRANCHNAME do ... but it doesn't - it has the default "release :PROJECTNAME do". Is this a bug or am I using it wrongly? Also, if I'm change the name of the release manually and then run mix release, the run script executed with the "start" parameter doesn't run my application anymore.

Distillery version: 2.0.12 Elixir version: 1.7.4

farao commented 5 years ago

The last sentence is actually a separate issue - shall I open a new one for it? To explain a bit further: When I leave the release name as default, I can run the program e.g. with _build/ENV/rel/RELEASE_NAME/bin/RELEASE_NAME foreground - when I use a custom name, the program doesn't start when running the same command with the new release name (all the scripts exist but they don't start the program).

bitwalker commented 5 years ago

It is not supported to change the release scripts in any way, there are specific points for customization/extensibility, and changing the names is not one of them, at least not without making a few other changes at the same time (updating $REL_NAME for example).

I've pushed a fix for the --name issue though, looks like the name was being ignored in non-umbrella projects for some reason.