-
-
Notifications
You must be signed in to change notification settings - Fork 774
Description
Hello,
thanks for the amazing tool that Taskfile is. I have a bit of advanced use case, so bear with me.
I am facing an issue with the current setup:
- I have three Taskfiles: A, B, C
- A includes B and calls B:up
- B includes C and calls C:up
- C has a variable that I want to be overridable:
C_VARIABLE: '{{.C_VARIABLE | default "localhost"}}'
this is the content of A.Taskfile.yml:
version: '3'
includes:
B:
taskfile: ./B.TaskFile.yml
tasks:
up:
cmds:
- task: B:upthis is the content of B.Taskfile.yml:
version: '3'
vars:
B_VARIABLE: b
includes:
C:
taskfile: ./C.TaskFile.yml
vars:
C_VARIABLE: "{{.B_VARIABLE}}"
tasks:
up:
cmds:
- echo "B_VARIABLE {{.B_VARIABLE}}"
- task: C:upand this is the content of C.Taskfile.yml
version: '3'
vars:
C_VARIABLE: '{{.C_VARIABLE | default "localhost"}}'
tasks:
up:
cmds:
- echo "C_VARIABLE {{.C_VARIABLE}}"If I run the following command it behaves as expected. Meaning that when B:up calls C:up, it overrides the variable C_VARIABLE with the content of B_variable=b
➜ t -t B.Taskfile.yml up
task: [up] echo "B_VARIABLE b"
B_VARIABLE b
task: [C:up] echo "C_VARIABLE b"
C_VARIABLE bif instead I run the same up task from A
➜ t -t A.Taskfile.yml up
task: [B:up] echo "B_VARIABLE b"
B_VARIABLE b
task: [B:C:up] echo "C_VARIABLE localhost"
C_VARIABLE localhostthe C_VARIABLE is not overridden but it uses the default value instead.
This is not what I was expecting
➜ t -t A.Taskfile.yml up
task: [B:up] echo "B_VARIABLE b"
B_VARIABLE b
task: [B:C:up] echo "C_VARIABLE b"
C_VARIABLE bAm I doing something wrong? Do I have wrong expectations or is this a bug?
- Task version: v3.20.0
- Operating System: MacOS arm64 architecture
ncampos92, jeremypetit-grtgaz, pestanko, apgrucza, gdraynz and 3 moreendorama
Metadata
Metadata
Assignees
Labels
No labels