Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Add a Bitbucket connector

Add a Bitbucket connector so Harness pipelines can pull code and other files from your Bitbucket Cloud or Data Center repositories.

Bitbucket is a Git repository management solution from Atlassian, offered as a cloud-hosted service (Bitbucket Cloud) and a self-managed instance (Bitbucket Data Center). It integrates closely with other Atlassian products, such as Jira and Confluence, and supports pull requests, branch permissions, and pipelines. Harness supports connecting to both Bitbucket Cloud and Bitbucket Data Center.

You connect Harness to Bitbucket using a Harness Bitbucket connector. This connector allows you to pull code and other files, such as Helm charts, Kubernetes manifests, and Terraform scripts, from your Bitbucket repositories for use in Harness pipelines.

Go to Overview for information about all code repos connectors, such as scopes, permissions and connectivity modes.

What you will learn from this topic


Before you begin

Before you create a Bitbucket connector, ensure you have:

  • A Bitbucket Cloud or Data Center account, with at least one repository.

  • A username and password, or an access token, with permission to read (and, if needed, write status checks to) the repositories you want to connect to.

  • Permission to create connectors in Harness.


Add a Bitbucket connector

You can add a Bitbucket connector at the project, org, or account scope. This procedure covers the project scope, and the process is the same for org and account.

You can also add a Bitbucket connector directly when configuring a Bitbucket codebase or artifact source in a pipeline or service.

Follow the interactive guide below for a step-by-step walkthrough:

Add a Bitbucket connector in Harness

Perform the following steps to add a Bitbucket connector:

  1. Open your Harness project.

  2. In Project Settings, select Connectors.

  3. Click New Connector, then select Bitbucket. The Bitbucket Connector settings appear.

Overview

Configure the identity fields for the connector.

In Name, enter a name for the connector. Optionally, add a description and tags. Click Continue.

Details

Configure the following details:

  1. For URL Type, select one of:

    • Account: Connect to an entire Bitbucket account or workspace. The connector can be used for every repository in that account.

    • Repository: Connect to a single Bitbucket repository.

  2. For Connection Type, select HTTP or SSH.

  3. Enter the Bitbucket Account URL or Bitbucket Repository URL, depending on the URL Type you selected. For example:

    • Account URL (HTTP): https://bitbucket.org/ACCOUNT_OR_WORKSPACE

    • Repository URL (HTTP): https://bitbucket.org/ACCOUNT_OR_WORKSPACE/REPO_NAME

    • Repository URL (SSH): git@ssh.bitbucket.org:ACCOUNT_OR_WORKSPACE/REPO_NAME.git

  4. If you selected Account for URL Type, enter a Test Repository. Harness uses this repository only to validate the connection. You specify the actual repository to use when you reference the connector in a pipeline.

  5. Click Continue.

Credentials

Configure the credentials based on the connection type you selected:

Go to Bitbucket connector settings reference for detailed information on Bitbucket connection settings.

Enable API access for build status updates and triggers

If you want to use Git Experience, send build or PR status updates back to Bitbucket, or to support Git event triggers and webhooks using the connector, select Enable API access and provide a Bitbucket personal access token as a Harness encrypted text secret.

Select Connectivity Mode

Select how Harness connects with Bitbucket:

  • Connect through Harness Platform: Use a direct, secure communication between Harness and Bitbucket. All credentials are encrypted and stored in the Secret Manager configured in Harness. This connectivity mode is required for Harness Cloud build infrastructure.

  • Connect through a Harness Delegate: Harness communicates with Bitbucket through a Harness Delegate you install in your environment, behind your corporate firewall.

Delegates Setup

If you selected Connect through a Harness Delegate, select either:

  • Use any available Delegate: Harness selects an available delegate at runtime.

  • Only use Delegates with all of the following tags: Select specific delegates for Harness to use with this connector.

Click Save and Continue.

Test Connection

Click Finish after the connection test succeeds. The connector is listed in Connectors.

If the connection test fails:

  • Confirm the account or repository URL matches the format for your selected URL Type and Connection Type.

  • Confirm the credential secret has not expired and has the required repository permissions.

  • If you are connecting through a delegate, confirm the delegate can reach your Bitbucket instance over the network (this applies especially to Bitbucket Data Center behind a firewall).

Kubernetes delegate with self-signed certificates

If this connector allows API access and connects through a Harness Delegate that uses self-signed certificates, you must specify ADDITIONAL_CERTS_PATH in the delegate pod. Go to Configure a Kubernetes build farm to use self-signed certificates for details.


Sample YAML

The following example shows a YAML for the Bitbucket connector created in this guide.

YAML - Bitbucket connector

For the full connector YAML schema, including how to skip connector preflight checks, go to Create a connector using YAML.


Next steps

Last updated

Was this helpful?