Skip to content
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

BuildConfig: adding environment variables #208

Closed
lholmquist opened this issue Mar 26, 2018 · 1 comment · Fixed by #210
Closed

BuildConfig: adding environment variables #208

lholmquist opened this issue Mar 26, 2018 · 1 comment · Fixed by #210

Comments

@lholmquist
Copy link
Member

lholmquist commented Mar 26, 2018

It is possible to add env vars to the buildConfig, https://docs.openshift.com/container-platform/3.7/rest_api/apis-build.openshift.io/v1.BuildConfig.html#object-schema

This would be good if someone needs to install dev dependencies during the build phase(they've set NODE_ENV=dev) or if they are wanting to use yarn, and need to set the YARN_ENABLED flag, https://github.com/bucharest-gold/centos7-s2i-nodejs/blob/master/s2i/assemble#L47

but what is the best way to do this for nodeshift. How should they be passed in? using a flag from the cli, or taking into account NODE_ENV vars that are placed at the beginning? or a combo?

Then also we need to make sure the programatic api gets them too.

@lholmquist
Copy link
Member Author

After looking at this a bit, i think i'm going to add a --build.env flag that can be used multiple times similar to the current -d flag, which allows multiple KEY=VALUE pairs to be passed in.

i was going to just do a -e flag but env vars can also go on the deployment config.

lholmquist added a commit to lholmquist/nodeshift that referenced this issue Apr 2, 2018
…onment variables

* can be used multiple times like 'nodeshift --build.env NODE_ENV=development --build.env YARN_ENABLED=true'

fixes nodeshift#208
@ghost ghost assigned lholmquist Apr 2, 2018
@ghost ghost added in progress review and removed next labels Apr 2, 2018
lholmquist added a commit to lholmquist/nodeshift that referenced this issue Apr 2, 2018
…onment variables

* can be used multiple times like 'nodeshift --build.env NODE_ENV=development --build.env YARN_ENABLED=true'

fixes nodeshift#208
lholmquist added a commit to lholmquist/nodeshift that referenced this issue Apr 2, 2018
…onment variables

* can be used multiple times like 'nodeshift --build.env NODE_ENV=development --build.env YARN_ENABLED=true'

fixes nodeshift#208
lholmquist added a commit to lholmquist/nodeshift that referenced this issue Apr 2, 2018
…onment variables

* can be used multiple times like 'nodeshift --build.env NODE_ENV=development --build.env YARN_ENABLED=true'

fixes nodeshift#208
@ghost ghost removed the review label Apr 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant