DevOps 管道触发多次触发来自原始管道的单个构建(有时)

时间:2021-07-22 18:03:08

标签: azure yaml azure-pipelines devops

我们为我们称为管道 B 的管道之一设置了以下 yml 代码:

resources:
  pipelines:
    - pipeline: pipeline a
      source: Pipeline A
      branch: master
      trigger:
        branches:
          include:
            - refs/heads/master
            - refs/heads/dev/*
            - refs/heads/feature/*
            - refs/heads/release/*
          exclude:
            - release/v1
        stages:
          #Trigger installer on completion of all stages
          - Stage1
          - Stage2
          - Stage3
          - Stage4
    - pipeline: OtherPipeline1
      source: pipeline1
      branch: master
    - pipeline: OtherPipeline2
      source: pipeline2
      branch: master
    - pipeline: OtherPipeline3
      source: pipeline3
      branch: master
    - pipeline: OtherPipeline4
      source: pipeline4
      branch: master
    - pipeline: OtherPipeline5
      source: pipeline5
      branch: master

trigger: none
pr: none

从代码中可以看出,Pipeline B 是由一些包含的分支以及Pipeline A 完成某些阶段的要求触发的。

由于某种原因,管道 B 偶尔会被管道 A 的管道触发器连续运行 3 次。

我们在管道 B 中添加了一些日志记录以验证触发这些额外调用的原因,这就是我们为每个实例获得的信息:

<块引用>

源分支:refs/heads/master

源分支名称:master

触发别名:管道 a

触发类别:管道

构建原因:ResourceTrigger

这种情况不会每次都发生,因此很难追踪。管道 B 中发生的每个构建发生在不同的时间间隔

我们的最新案例发生了以下构建(当没有人在工作时):

  • 第一次自动流水线触发:晚上 7:09
  • 第二次自动管道触发:晚上 7:13
  • 第三次自动管道触发:晚上 8:32

我们的 yaml 代码中是否有某些内容会导致三个管道触发器在不同时间触发?

当前理论(研究):

现在,除了 yaml 中列出的四个阶段之外,我们还有其他阶段,这些阶段在其他阶段在管道 A 中完成后继续运行(并随后触发管道 B)。我认为那些完成的人会在成功完成后重新触发管道触发器,并导致管道 B 中的额外构建

0 个答案:

没有答案