Closed sean-clayton closed 6 years ago
I generally recommend using Elixir's config mechanism as-is, rather than using environment variables for configuration settings. (Mostly because config happens at build time, not runtime, so you risk a lot of confusion by using environment variables like this—if you change environment variable values but the release has already been built, your changes will not have any effect.)
The "Elixir Way" is generally to have a "secret" config file (e.g. prod.secret.exs
) that you do not include in version control. Phoenix will set this up for you automatically by default.
If you're looking for a place to put such a file so it gets added at the right time, one approach is to keep it in Cloud Storage. Here's what that might look like. (Caveat: I believe this should work, but I haven't debugged the procedure myself.)
prod.secret.exs
file in source control (with dummy values for the secret properties) so your app will still compile in prod. Your custom build step should replace that dummy file with the actual secrets from Cloud Storage.Feel free to re-open if you have follow-up questions.
Howdy, I was wondering if there were a way to configure environment variables without hard-coding them inside of
app.yaml
For example, here is my mix config:
I'd like to be able to be able to modify
app.yaml
without hard-coding these values since I store myapp.yaml
in version control and was wondering if there's any possible way of doing this?