我试图弄清楚如何在编译时表达式中访问 Azure DevOps 矩阵变量。参考值始终为空/空/缺失。就像变量尚未设置。
这是我正在尝试的示例 yml 文件:
jobs:
- job: LinuxBuild
displayName: Pew Pew
strategy:
matrix:
debugJob:
buildConfiguration: Debug
releaseJob:
buildConfiguration: Release
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: echo ${{variables.debugJob.buildConfiguration}} ## <-- always null/empty
- script: echo ${{variables['debugJob.buildConfiguration']}} ## <-- always null/empty
- ${{ if eq(variables.debugJob.buildConfiguration, 'Debug') }}: ## <-- never ran/executed
- template: doSomething.yml@templates
Run Code Online (Sandbox Code Playgroud) azure-devops ×1