有人可以解释我如何从此矩阵作业设置访问变量build
吗?
parameters:
# job ---
...
configurations: [Release, Debug]
...
jobs:
- job: nightly
displayName: Nightly
strategy:
matrix:
${{ each configuration in parameters.configurations }}:
${{ configuration }}:
build: ${{ configuration }} # !PARAMETER/VARIABLE FOR JOB SET HERE!
${{ if ne(configuration, 'Release') }}:
dependsOn: Release
pool:
vmImage: ${{ parameters.image }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
steps:
- powershell: Write-Host ${{ paramteres.build }}
displayName: 'Write Configuration: ${{ parameters.build }}'
jobs powershell任务显示Write Configuration:
,因此变量为null?
答案 0 :(得分:0)
您可以像访问每个常规变量一样访问该变量:
$(build)
因此在您的管道中:
- powershell: Write-Host $(build)