Hello,
we are using Bitbucket Server and as part of our build pipeline we have been using the pull-request-notifier-for-bitbucket to trigger http request from Bitbucket to Jenkins in order to invoke custom events.
Basically, that plugins allows us to have custom buttoms in the PR, for example for doing a "Delegate Merge" or "Run Jenkins Build"; and if user selects it, an http request is sent to Jenkins:
The http request params contains parameter like PULL_REQUEST_ID, PULL_REQUEST_FROM_REPO_PROJECT_KEY, PULL_REQUEST_FROM_REPO_NAME, PULL_REQUEST_USER_NAME, PULL_REQUEST_FROM_BRANCH, PULL_REQUEST_TO_BRANCH, PULL_REQUEST_TITLE, PULL_REQUEST_AUTHOR_NAME, PULL_REQUEST_AUTHOR_EMAIL and some others.
There is a fork of that plugin for Bitbucket Datacenter, but there is nothing similar for Bitbucket Cloud. As Atlassian is going not going to provide support for Bitbucket Server anymore, I would like to know if is there any alternative to that plugin for Cloud (Datacenter is very expensive for us).
Or, if is there any other way (if possible from a PR in Bitbucket Cloud) to send an http request with such parameters to Jenkins.
Thanks in advance.
Hi Ginés and welcome to the community!
I did a search in Atlassian Marketplace with search terms 'pull request' and 'Jenkins'
I don't have in-depth knowledge of every single app, but checking their details, none of them seems to offer the option to manually trigger a Jenkins job.
The Webhook to Jenkins for Bitbucket app, as well as the Jenkins plugins for Bitbucket Cloud, seem to be based on webhooks. This means that they trigger a build as soon as an event from the webhook triggers occurs (e.g. pull request created, pull request updated, etc).
Bitbucket's CI/CD tool, Pipelines, can also be used to trigger a job in Jenkins, and pull-requests pipelines have PR-related variables. Pull-requests pipelines also get triggered when a PR is created or updated. However, if you set this up, you could do the following:
Another option would be to develop your own app with Forge, which would allow you to add a pull request action:
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.