简体   繁体   English

Jenkins多分支管道扫描无限重建

[英]Jenkins Multibranch Pipeline Scan infinite re-build

I have to deal with the following scenario: 我必须处理以下情况:

  1. I am running my Jenkins Pipeline on Blue Ocean + Git (+ Maven). 我正在Blue Ocean + Git(+ Maven)上运行我的Jenkins管道。
  2. I have setup the "Scan Multibranch Pipeline" option to check every X minutes if something has changed on the Git repo, and in that case start the job again... 我已经设置了“扫描多分支管道”选项,以每隔X分钟检查Git存储库中是否有任何更改,在这种情况下,请重新开始工作...
  3. My pipeline implements the usual build and test stages. 我的管道实现了通常的构建和测试阶段。
  4. My pipeline, as last stage, increments the snapshot version and pushes the updated POM to Git. 作为最后一个阶段,我的管道会增加快照版本,并将更新的POM推送到Git。

Step 4 triggers my issue : the "Scan Multibranch Pipeline" feature gets (forever) the branch as updated (by the commit at step 4). 步骤4触发了我的问题 :“扫描多分支管道”功能(永远)使分支(已更新)(通过步骤4的提交)。

How could I update the last "Scan Multibranch Pipeline" commit hash reference in order to stop job re-triggering? 我如何更新最后的“扫描多分支管道”提交哈希引用以停止作业重新触发?

Thank you in advance! 先感谢您! Antonio 安东尼奥

Colleague of mine wrote a plugin, 我的同事写了一个插件,

https://github.com/jenkinsci/ignore-committer-strategy-plugin Adds a 'Ignore committer' strategy. https://github.com/jenkinsci/ignore-committer-strategy-plugin添加了“忽略提交者”策略。

We used this to blacklist our CI Machine user. 我们使用它将CI Machine用户列入黑名单。 If the changeset contained the machine user, it would not be built. 如果变更集包含机器用户,则不会构建变更集。

正如@mkobit指出的那样,您可以使用提交消息,然后再次检查该消息(如果您已完成该工作,如果没有消息则提交),这是详细的链接如何避免Jenkins多分支管道作业自身触发

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM