-
-
Notifications
You must be signed in to change notification settings - Fork 867
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
let development env override production env #2
Conversation
…roduction env with development env if it exist
@bekzod can you describe when this would be useful? I'm not seeing why. In fact, in this scenario something like .env.development would end up overriding .env. Generally, .env is considered production, and the .env.development and .env.staging are more or less conveniences for local development. |
Closing. Will re-open if discussion opens up. |
What is an example of differences between |
IMHO, the
Now, if the database name changes, instead of simply changing it in |
Completely understand the pain of managing all of those groups of configurations. I feel like this approach is an anti-pattern for configuring a twelve-factor app:
If you need to test all of the configurations for all of your environments locally, I would suggest symlinking these to |
At risk of turning this into a long debate... I'd argue that if you're using dotenv as anything other than a tool to manage environment variables in a developer environment, then you're violating other rules listed in that article. All that aside, what is the benefit of doing it the current way, as opposed to how bekzod and I are proposing? |
The .env.environment should definitely be available as a feature. @jessefulton to your point about the relationship being inverted - can you confirm that the ruby version is that way? Looking at the code, I believe it is actually the same as our current implementation. It loads the environment and then overrides with the .env with the hash.merge - https://github.com/bkeepers/dotenv/blob/master/lib/dotenv.rb#L7 |
swapped loadEnv to loadEnvDotEnvironment, it will allow to override production env with development env if it exist