My goal is to add a new application environment variable to an Elixir/Phoenix app, which is released with the distillery and deployed with the edeliver.
Because I've added a new value to the prod.secret.exs
file, I'm expecting the new env variable to be not nil
when I'm calling Application.get_env(:my_app, :key)
on the production host.
Instead, I'm getting nil
. The fix I've applied is to stop the app, remove everything and deploy a brand new release. I guess it's not the correct fix.
So, how to correctly add new config variables?
What I've noticed so far. I'm putting the configuration I need to the prod.secret.exs
file and it's successfully used by distillery during the build process. In the generated release, the sys.config
file contains the new config vars. But var/sys.config
file of the deployed app does not contain the new config. If I manually put new config to the var/sys.config
and restart the release, then the var/sys.config
is regenerated without the new config vars.