hi! i've been trying to transition my phoenix setup from the development iex -S mix phx.server to doing something involving mix release. here's my actual dev command:
HTTPS_PORT="$HTTPS_PORT" iex --erl "-kernel inet_dist_listen_min 9100 inet_dist_listen_max 9105" --name "$NODE_NAME" --cookie "$COOKIE" -S mix phx.server
here's my attempt at turning this into some mix release thing:
MIX_ENV=prod mix release --overwrite && \
RELEASE_DISTRIBUTION=name RELEASE_NODE="$NODE_NAME" ERL_COOKIE="$COOKIE" ELIXIR_ERL_OPTIONS="-kernel inet_dist_listen_min 9100 inet_dist_listen_max 9105" HTTPS_PORT="$HTTPS_PORT" _build/prod/rel/my_app/bin/my_app start_iex
i'm glad that the HTTPS_PORT is being passed in correctly, but it's not setting the node name -- it's defaulting to my_app@my_hostname instead of the passed-in $NODE_NAME which is [email protected]. i ran System.get_env() and RELEASE_NODE is indeed my_app@my_hostname not [email protected]. i'm aware i can set something in the build artifact to change the env variables but I don't want to do that every time i run mix release --overwrite.
how do i bake in my desired RELEASE_NODE with running mix release --overwrite? i've tried exporting all the env variables before running mix release --overwrite but that didn't seem to do it:
run_release () {
export RELEASE_DISTRIBUTION=name
export RELEASE_NODE="$NODE_NAME"
export ERL_COOKIE="$COOKIE"
export ELIXIR_ERL_OPTIONS="-kernel inet_dist_listen_min 9100 inet_dist_listen_max 9105"
export MIX_ENV=prod
mix release --overwrite && \
HTTPS_PORT="$HTTPS_PORT" _build/prod/rel/my_app/bin/my_app start_iex
}