-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Support environment variables in nx.json #16179
Comments
Hey @jbadeau! This is something we are considering supporting for target options in general, rather than just in Imagine a migration that renames the project's jest configuration file. If the path to that file contains an env variable, or {projectRoot}, its another step that can be forgotten and makes our migrations a bit more fragile. This is the reason that its not currently supported, and also the reason that we don't support things like We will continue to evaluate the support, its not something that we've ruled out but something that needs to be considered. |
Now that v16 is loose is there any chance to have a look at this? As a first step, why not enable envvars for target options first. This is the main place where they are required. "release-gitlab": {
"executor": "@techx/helm:install",
"options": {
"chart": "nginx",
"version": "${CHART_VERSION}",
"release": "nginix"
}
} This would allow for many of the benefits but would not impact migration. |
This is something we are still evaluating the effects of, and determining the proper syntax and design for implementation. We don't want to break existing executors that may expect similar tokens to be present, as an example. Some of the core team is on vacation, once everyone is back I'll raise it and see what people's thoughts and concerns are, and then we can give it the green flag. Something like this isn't out of the question, just need to go about it the correct way. |
Any update on this issue? |
Description
I think supporting interpolating environment variables in at least the nx.json would be extremely welcome as it would dramatically simply pipelines.
Motivation
Tasks need to be able to read values from the env such as gitlab/github ci variables. Tasks could write envvars directly to the host or via .env files and subsequent tasks could pass them as options. Currently every plugin developer or user needs to create workarounds like postTarget from semvers to pass values from one task to another. All of your competitors support this and it makes the NX very verbose because of workarounds to get access to envvars.
Suggested Implementation
Alternative Implementation
The text was updated successfully, but these errors were encountered: