0

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

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.
4

1 回答 1

0

您可以尝试以下方法:

condition: and(succeeded(), eq(dependencies.A.outputs['prod.Name.Variable'], 'True'))
于 2020-03-09T09:59:18.783 回答