-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Environmental variables at compile time not available #685
Comments
No, partly because a compile isn't meant to be used in one exclusive environment, and partly because binaries should never be built with environment values hard coded into the compiled result - that misses the entire point of environment variables. Instead, adjust your code/config to actually look up your environment variables at runtime. This will solve both issues - the one you're asking about and the underlying one. |
So how can I use secret key base or external DB URL in my config files?
…On Fri, 12 Oct 2018 at 07:00, Dan Hunsaker ***@***.***> wrote:
No, partly because a compile isn't meant to be used in one exclusive
environment, and partly because binaries should never be built with
environment values hard coded into the compiled result - that misses the
entire point of environment variables.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#685 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADDRZdPaWCKUgIk4dbGuA-Yito4fl6gKks5ukCHbgaJpZM4XX9fn>
.
|
Same way. Especially for DB info/credentials, you want to pull those from the environment at runtime – even with only a single deploy environment, that information may change between compile and startup. As to the exact approach you should use to ensure that happens correctly, that's highly language- and framework-dependent, so you're better asking about that in communities more familiar with those. |
OK, that won't work in my case. Too bad, thanks. |
I know Elixir supports it. I don't know how. Ask around. |
Image: Elixir
Code that fails the build:
Error:
Is there a way to make env vars available at compile time?
The text was updated successfully, but these errors were encountered: