-
Notifications
You must be signed in to change notification settings - Fork 34
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
config/dotenv.js
does not respect environment assumed from ember deploy prod
#46
Comments
@lolmaus unfortunately with Ember CLI >= 2.16 we can not rely on environment detection made by Ember CLI: we have to initialize dotenv configs at I'm personally in favor of using @fivetanley @jasonmit thoughts? |
What I want is:
I don't want to end up doing
and then check for There is clearly a need for |
Well, we're already doing this: // Is it "ember test" or "ember t" command without explicit env specified?
if (!env && (process.argv.indexOf('test') > -1 || process.argv.indexOf('t') > -1)) {
env = 'test'
} https://github.com/fivetanley/ember-cli-dotenv/blob/2.0.0/index.js#L58-L61 |
ec-dotenv's default config file lookup strategy is centered around the EmberEnv when looking for the builds associated dotenv file. For most, that's sufficient. For you, and maybe others, you need the ability to override - which is possible as you already know. Short or writing our own plugin architecture (total overkill), you can write an ec-deploy plugin that sets
|
I just spent a lot of time trying to understand why |
Hi!
This is a follow-up to #30.
I use multiple dotenv files -- one per deploy target. My
config/dotenv.js
has logic to select a specific dotenv file provided in aDOTENV_FILE
env var (see #25). IfDOTENV_FILE
is empty, then it picks a default one depending onenvironment
.The problem is that
config/dotenv.js
runs before theember-cli-deploy
pipeline. It selects the development dotenv file, then theember deploy prod
command makesember-cli-deploy
use the production environment. The build becomes faulty.I have to run
DOTENV_FILE=prod ember deploy prod
every time, which is annoyingly redundant.I ended up using this workaround:
Maybe
ember-cli-dotenv
can do a similar thing to assume the environment. Maybe Ember CLI even offers a more robust way to access the command line params.The text was updated successfully, but these errors were encountered: