Jenkins: SCM triggering constant builds despite no change

前端 未结 5 1097
一个人的身影
一个人的身影 2021-02-02 10:55

We have a problem where despite no code changes SCM is triggering a build. SCM polls for changes every 15 minutes and should only trigger a build if changes are found.

H

5条回答
  •  暖寄归人
    2021-02-02 11:44

    I just ran into Jenkins continuously building due to an SCM change, even when there was no change, and polling was not even turned on. This may be different from your scenario but I figured it may still help to share my solution.

    Out project is configured to build using the branch specifier */integration just like all of our other integration builds. However, after looking at all of the branches on our origin git repo, I saw that there are two branches that matched the */integration specifier. It looks like a developer must have erroneously pushed to a new branch with a very similar name:

    $git branch --remote | grep integration
      origin/integration
      origin/origin/integration
    

    The solution that fixed this issue for me was to specify the branch fully, using refs/heads/integration. I assume it would also work to simply delete the duplicate offending branch, but by specifying the branch exactly I can avoid running into the same problem in the future.

    I'm not sure this is the same cause for your problem but this is what worked for me, and hopefully will work for someone else in this situation.

提交回复
热议问题