Integrating Bitbucket Cloud with Jenkins

Aruzhan Abduvali
aKumoSolutions-DevOps
3 min readFeb 12, 2024

Introduction

Streamlining the integration between Bitbucket Cloud and Jenkins allows for efficient automation of build and deployment processes. This documentation provides step-by-step instructions to guide you through setting up Bitbucket Cloud integration with Jenkins. By following these instructions, you can enhance collaboration, accelerate development workflows, and ensure a more efficient software delivery pipeline.

Prerequisites

Before proceeding, ensure you have the following:

  • Access to Bitbucket Cloud.
  • Access to Jenkins server.
  • Bitbucket username and password.
  • Basic understanding of Jenkins and Bitbucket concepts.

Step 1: Bitbucket Cloud Setup

Create App Password

  1. Navigate to Bitbucket Cloud.
  2. Go to “Personal settings” for the user.
  3. Create an App Password with the following permissions: Projects, Repositories, Pull Requests, and Webhook.

Step 2: Jenkins Server Setup

Install Bitbucket Branch Source Plugin

  1. Open Jenkins.
  2. Navigate to “Manage Jenkins” -> “Manage Plugins” -> “Available” tab.
  3. Search for “Bitbucket Branch Source” and install the plugin.

Configure Credentials

  1. Go to “Manage Jenkins” -> “Manage Credentials” -> “Jenkins” -> “Global credentials (unrestricted)”.
  2. Add a new credential of type “Username with password”.
  3. Use your Bitbucket username as the username.
  4. Use the App Password you generated as the password.

Set up Branch Endpoints

  1. Navigate to “Manage Jenkins” -> “Configure System”.
  2. Under “Custom Jenkins Root URL”, add your Jenkins server URL.

Step 3: Create New Jenkins Item

Organization Folder

  1. Click on “New Item” on the Jenkins dashboard.
  2. Choose “Organization Folder”.

Bitbucket Team/Project Source

  1. In the Organization Folder configuration, go to “Projects” -> “Repository Sources”.
  2. Choose “Bitbucket Team/Project” as the source.
  3. In “Credentials”, select the credential you created earlier.
  4. Set the “Owner” field with the value after the Bitbucket domain.

Note: In Owner you should put you bitbucket cloud owner.

Example:

In this blue line you need to see your owner name, copy it and put it to Owner section.

Conclusion

By completing these steps, you establish a robust connection between Bitbucket Cloud and Jenkins, enabling seamless automation of your build and deployment processes. This integration enhances collaboration, accelerates development workflows, and ensures a more efficient software delivery pipeline.

For visual guidance, refer to the tutorial video.

For any further assistance, refer to the official documentation of Jenkins and Bitbucket or reach out to the respective support teams.

--

--