Integrate Bitbucket and Jenkins to further customize your continuous integration practices
Over the past 12 months, the Dev Tools team at Appfire has made changes to Webhook to Jenkins for Bitbucket to make developers’ lives easier.
For the uninitiated, Webhook to Jenkins for Bitbucket works to integrate your Bitbucket repositories with the Jenkins continuous integration tool. This Bitbucket and Jenkins integration can automatically trigger Jenkins builds, view Jenkins builds inside Bitbucket, and so much more! Take a look at our documentation for details.
Here are some of the things we’ve worked on since this time last year.
Token support for Git Plugin 4.11.4+
Git plugin version 4.11.4 or higher requires the notifyCommit token when Bitbucket notifies Jenkins of any changes. Webhook to Jenkins version 6.2.0 supports this new requirement. Simply generate the token in Jenkins and enter it on the Bitbucket Jenkins Servers configuration page.
Direct Job Trigger endpoint
Webhook to Jenkins uses endpoints to select how Bitbucket communicates with Jenkins, which in turn helps to determine some of the functionality that the configuration uses. Until recently, users had a choice between using git or Bitbucket branch source plugins. With version 6.1.0, the Direct Job Trigger has been added.
The Direct Job Trigger endpoint allows you to emulate the click of the Build Now button on the Jenkins job page for selected jobs. When the hook event is fired, it has the same effect as clicking this button manually for the required jobs. Now you can choose the exact jobs to be triggered and not rely on the jobs selection and filtering on the Jenkins side, giving you clear control over what the repository is triggering.
Click the Jenkins Instance(s) tab, select Direct Job Trigger from the Jenkins Endpoint dropdown and begin.
Manually trigger builds for specific branches
Manually trigger a build for specific branches from the Bitbucket Branches, Commits, and Source pages. Doing so allows you to bypass the configurations in place, so that quick updates and fixes can be made.
Go to your Bitbucket repository Branches page, locate the branch you want to build, click … and select Trigger build.
Support for pull request approve event
The Pull Request Approved option was added to the Limit Events feature in February, 2022. In addition to the existing options that allow you to set the conditions that trigger a Jenkins build, the Pull Request Approved option does just what it says – triggers a Jenkins build when a pull request has been approved in Bitbucket.
This option allows for more automation, a more customized configuration, and is another example of our team implementing a new option based on feedback from our customers!
Simply select the Pull Request Approved option from Limit Events in Advanced Configuration.
Check if a pull request can be merged before notifying Jenkins
In a recent release, the pull request only triggers a job if there are no pending tasks and mergeable checks, a clear improvement from the days when no flags were thrown nor messages sent when a Jenkins build could be triggered before it had been approved.
Conflicting changes can also prevent a trigger when the Pull Request Merged option is enabled. Using this option helps to reduce confusion for false positives regarding non-ready code, and can reduce build-minutes for large environments.
Add new URL parameters
Webhook to Jenkins for Bitbucket supports sending custom job parameters to Jenkins during the notification/trigger process and adding them to the Jenkins URL. Additional parameters have been enabled to give your Jenkins jobs even more flexibility. In addition to the existing job parameters, the following parameters can be used:
|PR_TITLE||The title of the pull request (Only available in pull requests).|
|PR_REVIEWERS_SLUG||The pull request reviewer slugs (Only available in pull requests).|
|PR_REVIEWERS||The pull request reviewer display names (Only available in pull requests).|
|PR_VERSION||The version of the pull request (Only available in pull requests).|
|PR_ACTION||The action that triggered build for the pull request (Only available in pull requests).|
On the Bitbucket Builds page, select a job from the Jobs list, locate an item from the Builds list and click the Open Build in Jenkins button. Jenkins opens to the associated build.
Integration links to Jenkins builds on jobs page
We’ve introduced integration links to the jobs on the Bitbucket Builds page, so that each job on the Builds page has a link to the corresponding Jenkins build. This makes tracking down the Jenkins build associated with your job on the Bitbucket side as easy as clicking a button.
Across several Webhook to Jenkins versions, we have provided a number of UI improvements, security updates, and changes to error messages. This series of small changes simplifies the install and configuration process, adding up to a large improvement in the user experience!
- Change the Test Configuration button location to make it easier to find and use
- Improved messaging to alert when Poll SCM is not enabled
- Improved error handling for endpoint selection
- Proper Jenkins URL validation and error handling
- Improved Jenkins page hint/documentation
- Update to Webhook to Jenkins access on the Bitbucket Hooks page
We thought it was time to update our image. No more polyester leisure suits for us! And while we’re at it, why not update Webhook to Jenkins look too? To better align with the other Appfire products, Webhook to Jenkins has transformed, including an updated product logo, new images, and revamped documentation.
We heard you loud and clear that you want one portal for your support tickets, one vendor to build and maintain your favorite apps, and one trusted ally within this incredible ecosystem to help you get more out of your Atlassian tools.
Switch to tab-based layout
A tab-based layout has been introduced in the hook configuration dialog. Prior to this update, Jenkins Instance(s), General settings, and Advanced Configuration were all on a single page, and you had to scroll up and down to access the various configuration options.
Try Webhook to Jenkins for free
Don’t just take our word for it; try Webhook to Jenkins for yourself – free!
- Log into your Bitbucket instance as an admin.
- Click the Administration cog icon in the top-right corner of any Bitbucket page to open the Manage apps page.
- When the Administration menu bar opens on the left side of the page, click Find New Apps, located under the ADD-ONS heading.
- Locate Webhook to Jenkins
- via the Search the Marketplace field and select it from the search results.
- Click Try it free to begin a new trial.
The inspiration for every change we’ve made comes from you, the community we have the privilege to serve. Your feedback and suggestions help us to continuously improve Webhook to Jenkins. Don’t hesitate to contact us if you think something can be better.
Last updated: 2022-09-30