I expected ‘mix phx.gen.secret’ to generate a secret as the lone output. Many example of its usage are to set the environment variable for use in deployments, e.g.:
export SECRET_KEY_BASE=mix phx.gen.secret
When I use perform this command, what I get when I inspect SECRET_KEY_BASE is:
'__________________________________
| => echo ${SECRET_KEY_BASE}
_build apps config deps elixir_buildpack.config junk mix.exs mix.lock package-lock.json phoenix_static_buildpack.config rel runtime.log Running mix loadconfig (inside Rumbl.Umbrella.MixProject) _build apps config deps elixir_buildpack.config junk mix.exs mix.lock package-lock.json phoenix_static_buildpack.config rel runtime.log Running mix deps.loadpaths (inside Rumbl.Umbrella.MixProject) _build apps config deps elixir_buildpack.config junk mix.exs mix.lock package-lock.json phoenix_static_buildpack.config rel runtime.log Running mix phx.gen.secret (inside Rumbl.Umbrella.MixProject) Fl1p1XPidhd0W28PP3ZyFtP/7R6PD2Hnr/7aMCDCSHbBMfcDED3lkRo1cjgqjfS4
’
where the secret is the last part, the preceding part is mix output. I thought that mix phx.gen.secret would output only the actual secret by itself. So I am a little confused on how performing an export on the environment variable SECRET_KEY_BASE make sense in all the examples I have seen so far. I could use some much appreciated direction here. I feel like I am missing something. Best.
I also notice if I just execute:
‘mix phx.gen.secret’
on the command line then the output will be different but will also contain some mix output before the actual generated secret.
’
| => mix phx.gen.secret
** Running mix loadconfig (inside Rumbl.Umbrella.MixProject)
** Running mix deps.loadpaths (inside Rumbl.Umbrella.MixProject)
** Running mix phx.gen.secret (inside Rumbl.Umbrella.MixProject)
sImmy3MXXmQcACHgoUivw0+5PLpoR9vMfHSUSAi9kv3Plh4fdNnYVhSCbdRLfKCa
’