Comments (9)
it seems that env
is not properly set when issuing ember deploy production
a workaround is specified in this issue #46
this worked for me
/* eslint-env node */
'use strict';
const path = require('path');
module.exports = function(env) {
// $ ember deploy production
// [0] = node
// [1] = ember
// [2] command = deploy
// [3] target = production
const [,, command, target] = process.argv;
if (command && target && command === 'deploy') {
env = target;
}
const isProd = env == 'production';
const isStaging = env == 'staging';
const envFile = (isProd || isStaging) ? `.env.deploy.${env}` : '.env';
return {
clientAllowedKeys: [...],
path: path.join(__dirname, '..', envFile)
};
};
from ember-cli-dotenv.
Forgot to mention that this is the behavior in 2.0.0
On the master branch path: '../.env.deploy.${env}'
fails with:
[ember-cli-dotenv]: ENOENT: no such file or directory, open '../.env.deploy.development'
from ember-cli-dotenv.
same
from ember-cli-dotenv.
Any news?
from ember-cli-dotenv.
Same. Updates @fivetanley?
from ember-cli-dotenv.
@sescobb27 where have you put this code?
from ember-cli-dotenv.
@viniciussbs in config/dotenv.js
from ember-cli-dotenv.
Thank you, @sescobb27. I'll give it a try.
from ember-cli-dotenv.
Here I am in 2020 and I had this same puzzling issue. Not sure why it happened in a new ember app but didn't in another one also running dotenv 3, but this was really puzzling and surprising.
The code above helped, but it needed a small modification to support other commands from ember-cli-deploy
like ember deploy:list prod
, etc etc
For future confused travelers to this thread or #46
// config/dotenv.js
'use strict';
const path = require('path');
module.exports = function(env) {
// $ ember deploy production
// [0] = node
// [1] = ember
// [2] command = deploy
// [3] target = production
const [,, command, target] = process.argv;
if (command && target && (command === 'deploy' || command.indexOf("deploy:") == 0)) {
env = target;
}
const isProd = (env == 'production' || env == 'prod');
const isStaging = env == 'staging';
const envFile = (isProd || isStaging) ? `.env.deploy.${env}` : '.env';
return {
clientAllowedKeys: [...],
path: path.join(__dirname, '..', envFile)
};
};
from ember-cli-dotenv.
Related Issues (20)
- FastBoot support HOT 10
- Picking a specific dotenv file via CLI param HOT 2
- Installing gives errors somekey is not defined
- ignore exports in variable defs HOT 1
- Make .env.production effective on ember s -prod HOT 1
- This addon is incompatible with [email protected]+ HOT 47
- Unable to install v2.0 HOT 2
- Ability to check for variable presence HOT 5
- `config/dotenv.js` does not respect environment assumed from `ember deploy prod` HOT 5
- Release a new version to npm? HOT 1
- Started getting this.ui.warn error since yesterday HOT 1
- Installation fails with "Cannot read property 'clientAllowedKeys' of undefined" HOT 5
- Travis missing ENV vars HOT 2
- Use failOnMissingKey in CI build HOT 5
- The default lookup path of .env is not documented HOT 2
- Environment not recognized correctly while using ember build --prod HOT 2
- Fix CI HOT 1
- env vars not loaded in `.ember-cli.js` HOT 1
- Use for local development only HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-cli-dotenv.