Azure管道检查单个矩阵作业的状态

时间:2020-03-06 08:37:11

标签: azure-devops azure-pipelines azure-devops-server-2019 azure-devops-server

如何在矩阵策略中检查单个作业的状态?

jobs:
  - job: A
    strategy:
      matrix:
        nonprod:
          environment: test
        prod:
          environment: prod
    steps:
      - pwsh: Write-host something random
  - job: B
    dependsOn: A
    condition: how do I check only the prod portion of the Job A ?
    steps:
      - pwsh: Write-Host this should run regardless of nonprod matrix portion, but only if prod has succeeded.

1 个答案:

答案 0 :(得分:0)

您可以尝试以下操作:

condition: and(succeeded(), eq(dependencies.A.outputs['prod.Name.Variable'], 'True'))