【发布时间】:2021-03-18 21:13:08
【问题描述】:
我想使用一个参数来启用管道在运行在专用代理或 Azure 主机之间的切换
池: 名称:默认
和
池: vmImage: 'ubuntu-latest'
parameters:
- name: custom_agent
displayName: Use Custom Agent
type: boolean
default: true
pool:
${{ if eq(parameters.custom_agent, True) }}:
name: ${{ parameters.agent_pool }}
${{ if eq(parameters.custom_agent, False) }}:
vmImage: 'ubuntu-latest'
我尝试了各种变体,但不断收到错误“此上下文中不允许使用模板表达式”
我错过了什么吗?感觉这不应该那么难。
【问题讨论】:
标签: azure-devops azure-pipelines-build-task