Several steps are required to configure Jenkins to integrate with your Bitbucket repository.
Configuring Jenkins using either the Classic UI or the Blue Ocean plugin
Configuring Bitbucket:
Globally - Administration (gear icon top right) > Jenkins instances
Project or Repository hook settings
Implementing General Settings or Advanced Configuration features depending on your development requirements.
To successfully use Webhook to Jenkins, the configuration process is made up of two parts:
Your Jenkins instance
Your Bitbucket project or repository
This document does not include detailed instructions regarding the initial setup of your Jenkins or Bitbucket instances. For more information regarding these topics, refer to Bitbucket and Jenkins documentation.
This documentation uses screenshots taken from Jenkins version 2.332.2 and Bitbucket version 7.20.0.
Before you begin
Before you begin configuring your Jenkins instance, confirm the following actions have been performed:
Install either the Bitbucket Source Branch plugin or the Git plugin, depending on the option you and your organization use. Refer to the what plugin should I use page for more information regarding what
Install Webhook to Jenkins.
Add a new instance of Jenkins in Bitbucket
Adding an instance of Jenkins in Bitbucket makes configuring project-level and repository-level easier by allowing Webhook to Jenkins to use the entered Jenkins instance location as the default URL.
While the instructions in this section are optional, we recommend this step as it makes subsequent setup and configuration steps simpler.
Log into your Bitbucket instance as an Administrator.
Click the Administration icon in the top right corner to open the Administration page.
Under Add-ons, click Jenkins Servers.
Click Add New Instance.
Enter the Jenkins instance URL in the Jenkins Base field and the Jenkins Username and Password.
Click Save Instance.
You can also access this page through Bitbucket Administration (Administration > Manage Apps > Webhook to Jenkins for Bitbucket > Configure).
When configuring Webhook to Jenkins at both the project and repository levels, the Jenkins instance URL is the default entry in the URL field.
Proceed to the Jenkins configuration or Bitbucket configuration sections.