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

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

本文介绍了Jenkins多分支管道扫描无限重建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须处理以下情况:

  1. 我正在Blue Ocean + Git(+ Maven)上运行我的Jenkins管道.
  2. 我已设置扫描多分支管道"选项,每隔 X 分钟检查Git存储库中是否有更改,然后重新启动工作...
  3. 我的管道实现了通常的构建和测试阶段.
  4. 作为最后一个阶段,我的管道会增加快照版本,并将更新的POM推送到Git.
  1. I am running my Jenkins Pipeline on Blue Ocean + Git (+ Maven).
  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...
  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.

步骤4触发了我的问题:扫描多分支管道"功能(永久)获得更新的分支(通过步骤4的提交).

Step 4 triggers my issue: the "Scan Multibranch Pipeline" feature gets (forever) the branch as updated (by the commit at step 4).

我如何更新最后一个扫描多分支管道"提交哈希引用,以停止重新触发作业?

How could I update the last "Scan Multibranch Pipeline" commit hash reference in order to stop job re-triggering?

先谢谢您!安东尼奥

推荐答案

我的同事写了一个插件,

Colleague of mine wrote a plugin,

https://github.com/jenkinsci/ignore-committer-strategy-plugin 添加了忽略提交者"策略.

https://github.com/jenkinsci/ignore-committer-strategy-pluginAdds a 'Ignore committer' strategy.

我们使用它将此CI机器用户列入黑名单.如果变更集包含机器用户,则不会构建变更集.

We used this to blacklist our CI Machine user. If the changeset contained the machine user, it would not be built.

这篇关于Jenkins多分支管道扫描无限重建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 14:52