-
Notifications
You must be signed in to change notification settings - Fork 41
It is possible to use a context's variables in a task? #94
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I am working with taskctl to simplify some builds and to use PowerShell as my context for the task. I have sucessfully created a context that allows me to do this.
From the docs, I had thought that I would be able to set some variables in the context and then use them in the task which uses that context, like so:
contexts:
powershell:
executable:
bin: pwsh
args:
- -NoProfile
- -Command
variables:
test_arguments: "-v q /p:CollectCoverage=true /p:CoverletOutputFormat=opencover"
tasks:
test:unittest:
context: powershell
description: Perform unit tests
command:
- build/scripts/Invoke-DotNetTests.ps1 -arguments {{ .test_arguments }}
env:
pattern: "*UnitTests"However, when I run this i get the error message:
time="2021-11-12 14:59:45" level=info msg="Running task test:unittest..."
time="2021-11-12 14:59:45" level=info msg="test:unittest finished. Duration 498.7µs"
time="2021-11-12 14:59:45" level=fatal msg="task test:unittest failed: template: interpolate:1:76: executing \"interpolate\" at <.test_arguments>: map has no entry for key \"test_arguments\""
Does this mean it is not possible to interpolate variables set in the context?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working