I'm trying to figure out the syntax for specifying demands
for a pool
in a yaml
template in Azure DevOps
using parameters
So I have a template like this:
parameters:
pool: ''
demands: ''
jobs:
- job: 'Job1'
pool:
name: ${{parameters.pool}}
demands: ${{parameters.demands}}
And calling it like:
- template: 'shared_pipeline.yml'
parameters:
pool: 'poolname'
demands: >-
FPGA -equals True
CI -equals True
I've tried many different combinations like exchanging >-
with |-
Changing demands: ${{parameters.demands}}
to
demands: |
- ${{parameters.demands}}
Since the original syntax for multiple demands is:
demands: |
- FPGA -equals True
- CI -equals True
But all the time I either get an error saying the syntax is wrong:
job_templates/shared_pipeline.yml (Line: 10, Col: 14): Invalid demand 'FPGA -equals True CI -equals True'. The demand should be in the format '<NAME>' to test existence, and '<NAME> -equals <VALUE>' to test for a specific value. For example, 'VISUALSTUDIO' or 'agent.os -equals Windows_NT'
or:
No agent found in pool pool which satisfies the specified demands:
FPGA -equals True CI -equals True
And I've triple checked that there is and agent that has these capabilities.
It seems to me like the parameters are not getting.. expanded? correctly, like they're still on one line instead of one line each.
I've tried looking at the Azure DevOps documentation, but there are no examples of this kind of usage. I've tried googling, but couldn't find a solution