Skip to content

Use Bitbucket Cloud as your source code provider»

Spacelift supports Bitbucket Cloud as the code source for your stacks and modules.

You can set up multiple Space-level and one default Bitbucket Cloud integration per account.

Create the Bitbucket Cloud integration»

Bitbucket Cloud integration details

Learn more about setting up and using the Bitbucket integration on the Bitbucket Cloud source control page.

Initial setup»

  1. On the Source control tab, click Set up integration, then choose Bitbucket Cloud on the dropdown. Create a Bitbucket integration
  2. Integration name: Enter a name for your integration. It cannot be changed later because the Spacelift webhook endpoint is generated based on this name.
  3. Integration type: Default (all spaces) or Space-specific. Each Spacelift account can only support one default integration per VCS provider, which is available to all stacks and modules in the same Space as the integration.

Migration from App Passwords to API Tokens

Previously, this integration used Bitbucket App Passwords for authentication. Atlassian has deprecated App Passwords and replaced them with API tokens.

Create your API token»

You will need to create an API token for this integration on the Bitbucket Cloud site.

  1. Navigate to Atlassian account settings > Security > Create API token with scopes.
  2. Fill in the details to create a new API token:

    1. Choose a name for your API token.
    2. Set an expiration date.
    3. Select Bitbucket as the app.

      Api token app

    4. Select read permissions for:

      • Repository
      • Pull requests

      Api token permissions

  3. Click Create.

  4. Copy the API token details to finish the integration in Spacelift.

Copy details into Spacelift»

Now that your API token has been created, return to the integration configuration screen in Spacelift.

  1. Email: Enter your Bitbucket Cloud email address.
  2. API token: Paste the API token that Spacelift will use to access your Bitbucket Cloud repository.
  3. Labels: Organize integrations by assigning labels to them.
  4. Description: A markdown-formatted free-form text field to describe the integration.
  5. Click Set up to save your integration details. Filled integration details

Set up webhooks»

For every Bitbucket Cloud repository being used in Spacelift stacks or modules, you will need to set up a webhook to notify Spacelift about project changes.

Note

Default integrations are visible to all users of the account, but only root Space admins can see their details.

Space-level integrations will be listed to users with read access to the integration Space. Integration details, however, contain sensitive information (such as the webhook secret) and are only visible to those with admin access.

  1. On the Source code page, click the three dots next to the integration name.
  2. Click See details to find the webhook endpoint and webhook secret. Find webhook endpoint and secret

Configure webhooks in Bitbucket Cloud»

For each repository you want to use with Spacelift, you now need to add webhooks in Bitbucket Cloud.

  1. In Bitbucket Cloud, select the repository you are connecting to Spacelift.
  2. Navigate to Repository settings > Webhooks.
  3. Click Add webhook. Webhooks configuration
  4. Title: Enter a name for the webhook.
  5. URL: Paste the webhook endpoint from Spacelift.
  6. Secret: Paste the webhook secret from Spacelift.
  7. Status: Check Active.
  8. Triggers:
    1. Under Repository, check Push.
    2. Under Pull Request, check:
      • Created
      • Updated
      • Approved
      • Approval removed
      • Merged
      • Comment created
  9. Click Save.

Finally, you should install the Pull Request Commit Links app to be able to use this API. The app is installed automatically when you go to the commit's details and click Pull requests.

Commit's details

✅ Step 1 of the LaunchPad is complete! Now you can connect your cloud account.