-
Notifications
You must be signed in to change notification settings - Fork 41
Task-level variables are not available from pipeline #95
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Encountered issue on Windows 10 using taskctl version 1.4.2.
When running the following taskctl.yaml an error is encountered:
pipelines:
pipeline1:
- task: task1
tasks:
task1:
description: "Example task 1"
command: "echo hello {{ .message }}"
variables:
message: "world"
taskctl run pipeline1
time="2022-01-12 21:16:11" level=info msg="Running task task1..."
time="2022-01-12 21:16:11" level=info msg="task1 finished. Duration 0s"
time="2022-01-12 21:16:11" level=fatal msg="pipeline pipeline1 failed: template: interpolate:1:14: executing \"interpolate\" at <.message>: map has no entry for key \"message\""Setting the variables at a task level within pipeline map will be correctly be passed to the task level:
pipelines:
pipeline1:
- task: task1
variables:
message: "world"
tasks:
task1:
description: "Example task 1"
command: "echo hello {{ .message }}"
taskctl run pipeline1
time="2022-01-12 21:21:58" level=info msg="Running task task1..."
task1: hello
task1:
task1: world
time="2022-01-12 21:21:58" level=info msg="task1 finished. Duration 527.7µs"
Summary:
- Stage task1 was completed in 1.58ms
Total duration: 50.0753msI suppose after clarifying the issue it technically works, but the variables must be put into the pipeline rather than the task level. I find this slightly non-intuitive, but if it is working as designed feel free to cancel this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working