-
-
Notifications
You must be signed in to change notification settings - Fork 637
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
Dynamic variable execution environment does not inherit globally set environment variables #630
Comments
Hi @kerma, Good catch! I think it makes sense to fix this and make it consistent. It may not be extremely easy, though. The variables pipeline is a separate process than the actual execution. |
I'll do some investigation myself to figure out the complexity of it. |
This issue seems to have been abandoned but the inconsistent behavior is still there. Can this be given higher priority? What's the situation with complexity, @kerma ? Additionally, when working around this with a environment variable defaults, it does not work at the taskfile level, only inside the task: version: 3
env:
ENV: '{{default "dev" .ENV}}'
STACK_NAME: '{{default "development" .STACK_NAME}}'
vars:
COMPONENT_NAME:
sh: if [[ {{.ENV}} == "prod" ]]; then echo com.company.ProductionComponent; else echo {{.ENV}}.{{.STACK_NAME}}.DevelopmentComponent; fi
tasks:
debug:
cmds:
- echo {{.ENV}}
- echo {{.STACK_NAME}}
- echo {{.COMPONENT_NAME}} Will produce:
Moving the |
This looks like a similar issue to #1742 which has a PR for a potential fix. |
It may be as designed, but it's been bugging me for a while and creates quite a bit of confusion. So if nothing else, I'll document the behavior here.
See the following example:
Output:
That makes dynamic variables a bit useless in places where you need to pass auth or other relevant info via env.
The text was updated successfully, but these errors were encountered: