【问题标题】:Azure pipelines checking status of individual matrix jobsAzure 管道检查单个矩阵作业的状态
【发布时间】:2020-03-06 08:37:11
【问题描述】:

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

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.

【问题讨论】:

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


    【解决方案1】:

    您可以尝试以下方法:

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

    【讨论】:

    • 在这一点上,与提供的好处相比,矩阵似乎造成了更多的麻烦,我想我会坚持做简单的工作。
    • 坦率地说还没有测试过,因为在我看来,仅仅为了查看工作是否成功而产生输出有点麻烦,这是一种解决方法而不是解决方案。
    猜你喜欢
    • 2019-11-05
    • 2020-03-30
    • 2022-11-14
    • 2021-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-23
    相关资源
    最近更新 更多