ember-cli-dotenv icon indicating copy to clipboard operation
ember-cli-dotenv copied to clipboard

Use failOnMissingKey in CI build

Open dguayrobotiq opened this issue 6 years ago • 5 comments

Is there a way to use failOnMissingKey option in a CI build so it takes process.env variables into account?

If not, that could be an option like systemvars in dotenv-webpack plugin? I could make a PR for this if that makes sense to you

dguayrobotiq avatar Nov 08 '18 16:11 dguayrobotiq

@dguayrobotiq currently failOnMissingKey is not setup that way. I doubt it's scope for this addon as it's purpose - pull keys from .env file and make them available in Ember app.

Sounds like a feature request at first place - fallback to process.env if variable can not be found in .env file? And then, once above logic is implemented, failOnMissingKey will behave as you expect.

Do I follow your thought-process?

SergeAstapov avatar Nov 08 '18 19:11 SergeAstapov

@SergeAstapov Yes that would work too.

dguayrobotiq avatar Nov 08 '18 19:11 dguayrobotiq

@SergeAstapov Is this something that could be done or should I work on a PR?

dguayrobotiq avatar Nov 15 '18 19:11 dguayrobotiq

@dguayrobotiq could you please share a use case where you need this? A PR would be great!

SergeAstapov avatar Nov 21 '18 04:11 SergeAstapov

@sandydoo Prevent a CI deployment to pass if an environment variable is missing in the CI (which export environment variables and are accessible from process.env). Just like dotenv-webpack plugin permits with the systemvars option

dguayrobotiq avatar Nov 21 '18 13:11 dguayrobotiq