-
Notifications
You must be signed in to change notification settings - Fork 32
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
path option doesn't behave well with ember-cli-deploy's development workflow #48
Comments
Forgot to mention that this is the behavior in 2.0.0 On the master branch |
same |
Any news? |
Same. Updates @fivetanley? |
it seems that 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)
};
}; |
@sescobb27 where have you put this code? |
@viniciussbs in |
Thank you, @sescobb27. I'll give it a try. |
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 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)
};
}; |
I am using this addon with ember-cli-deploy's development workflow. I have 3 different env files for different environments:
.env.deploy.${env}
.Here's the
config/dotenv.js
contents:Running
ember s
works fine for the development environment butember deploy staging
andember deploy production
commands seem to not find the correct env file.Changing the path variable from
./.env.deploy.${env}
to../.env.deploy.${env}
does the trick.The text was updated successfully, but these errors were encountered: