pull-request-notifier-for-bitbucket
                                
                                 pull-request-notifier-for-bitbucket copied to clipboard
                                
                                    pull-request-notifier-for-bitbucket copied to clipboard
                            
                            
                            
                        any docs/info on using it w/ a Jenkins Pipeline?
Anyone ever set this up on a Jenkins Pipeline? Can't figure out how to get it to handle the PR branch name and what happens if multiple PRs come in at the same time...
Been working with this plugin and Jenkins Pipeline. We are using the buildWithParameters API, and passing in information from the PR via this tool to the Jenkins as parameter values. As for multiple PRs, the Jenkins job we have disabled "Do not allow concurrent builds" in Jenkins and run a cluster of build machines linked to Jenkins.
We do it the same way @Cardds explain. But, we use the throttle plugin to limit the number of concurrent builds per node to 1.
The checkout step in the pipeline would be: checkout scm: [$class: 'GitSCM', branches: [[name: "*/${PULL_REQUEST_FROM_BRANCH}"]], userRemoteConfigs: [[url: "${PULL_REQUEST_FROM_SSH_CLONE_URL}", clean: true, credentialsId: 'a96aece8-fef6-4997-bd74-e4c2e1cc30e4']]]
@fredrikand : how do you get ${PULL_REQUEST_FROM_BRANCH}? and ${PULL_REQUEST_FROM_SSH_CLONE_URL}?
@kenyee We send them from the notification. The URL we use is
https://jenkins.domain.se/job/pull-request/buildWithParameters?token=
Configure the Jenkins job to be parameterized. In newer Jenkins, you need to configure all params you want to use. All undefined params are discarded.
Hi, To comment @fredrikand 'you need to configure all params', because of this, I logged a question here. Anyone around here, has a solution?
Thanks.
using build with with parameters is the way to go, there are a few other little issues to get the whole thing hanging together, a full write up is here https://dengelonsoftware.blogspot.co.uk/2017/01/jenkins-pull-request-and-pipeline.html
We ended up implementing a parameterized seed job that creates (and triggers) a separate pipeline job per pull request via JobDSL. This seed job is triggered by pull-request-notifier-for-bitbucket.
So we have something like when using (bitbucket-)branch-source-plugin but without its bugs and with waymore flexibility (at the cost of a bit more complexity mainly due to the custom seed job).