BitBucket does not update refspec for PR, causing Jenkins to build old commits

后端 未结 2 928
庸人自扰
庸人自扰 2021-01-27 00:22

I am using a local BitBucket server with Git. I am trying to get started with Continous Integration so I\'ve set up a local Jenkins instance. The goal is to have Jenkins check o

2条回答
  •  不要未来只要你来
    2021-01-27 00:36

    See Daves answer for an explanation on why this "problem" arise and why Bitbucket is designed in this way.

    However i was able to solve my specific problem by changing the settings in the Jenkin-plugin, to "trick" Bitbucket into updating the refs.

    By setting the option Build only if Stash reports no conflicts to true in Jenkins (Under Build Trigger for the job), you force Bitbucket to update the refs which means you will check out the correct commit

    See https://github.com/nemccarthy/stash-pullrequest-builder-plugin/issues/75 for details

提交回复
热议问题