Jenkins Multibranch Pipeline Scan infinite re-build

余生颓废 提交于 2019-12-23 01:43:25

问题


I have to deal with the following scenario:

  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.

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?

Thank you in advance! Antonio


回答1:


Colleague of mine wrote a plugin,

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

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




回答2:


As @mkobit pointed out you can use a commit message and check that message again if you have already done that job and if there is no message commit it Here is the detailed link How to avoid Jenkins multibranch pipeline job triggering itself



来源:https://stackoverflow.com/questions/49736540/jenkins-multibranch-pipeline-scan-infinite-re-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!