How to pass --erl arguments to a mix release?

I need that the release have --name instead of --sname and need to pass some other env vars specific to that release.

For instance

mix release node1 => iex --name node1@127.0.0.1 --erl "-project port 5555 -project nodes []" -S mix

mix release node2 => iex --name node2@127.0.0.1 --erl "-project port 5556 -project nodes [node1]" -S mix

How can I achieve this behaviour?

When you initiated the release support with mix release.init, it had created three files in rel folder.

vm.args.eex is a template for erlang params, its skeleton is self-explanatory.

3 Likes

Alternatively ERL_OPTS envoronment variable can be used.

3 Likes

As a future reference for whoever is reading - the environment variable is called ERL_FLAGS, not ERL_OPTS. See Erlang -- erl

3 Likes