[英]Jenkins multibranch pipeline does not detect pull requests in Bitbucket server
I am having trouble getting Jenkins multibranch pipeline detect pull requests created in the Bitbucket server (private instance).我无法让 Jenkins 多分支管道检测在 Bitbucket 服务器(私有实例)中创建的拉取请求。 I have setup the "Bitbucket server webhook to Jenkins" which is triggering the build on master, develop and feature branches except pull-requests.我已经设置了“Bitbucket server webhook to Jenkins”,它触发了在 master、develop 和 feature 分支上的构建,除了 pull-requests。 I have defined the build steps in Jenkisfile and can confirm the PR branch also includes the Jenkinsfile.我已经在 Jenkisfile 中定义了构建步骤,并且可以确认 PR 分支也包括 Jenkinsfile。 In the Jenkins configuration, I have enabled "Discover branches" under Branch Sources configuration在 Jenkins 配置中,我在 Branch Sources 配置下启用了“发现分支”
Pull Request isn't a branch, it is usually something that is done prior to publishing to a branch. Pull Request 不是分支,它通常是在发布到分支之前完成的事情。 Usually, the pull request is approved, then published to the master branch.通常,拉取请求被批准,然后发布到主分支。
Ok.好的。 After multiple trial and error and google search, I have managed to get the Jenkins Multibranch pipeline work with Bitbucket server.经过多次反复试验和谷歌搜索,我设法让 Jenkins Multibranch 管道与 Bitbucket 服务器一起工作。 The key was to use 'Bitbucket' (from bitbucket branch source plugin) as the Branch source.关键是使用'Bitbucket'(来自bitbucket 分支源插件)作为分支源。 Also, I had to include a dummy trigger in my Jenkinsfile for the Jenkins webhook to work from bitbucket此外,我必须在我的 Jenkinsfile 中包含一个虚拟触发器,以便 Jenkins webhook 从 bitbucket 工作
triggers { bitbucketPush() pollSCM('0 0 1 1 0') }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.