Use Bitbucket Data Center as your source code provider»
Spacelift supports Bitbucket Data Center (on-premise) as the code source for your stacks and modules.
You can set up multiple Space-level and one default Bitbucket Data Center integration per account.
Create the Bitbucket Data Center integration»
Bitbucket Data Center integration details
Learn more about setting up and using the Bitbucket integration on the Bitbucket Data Center source control page.
Initial setup»
- On the Source control tab, click Set up integration, then choose Bitbucket Data Center on the dropdown.
- Integration name: Enter a name for your integration. It cannot be changed later because the Spacelift webhook endpoint is generated based on this name.
- 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.
Create an access token»
You will need to create an access token in Bitbucket to use with Spacelift. The token requires the following access:
- Read access to any projects Spacelift needs to be able to access.
- Read access to the repositories within those projects.
- Navigate to Manage account > Personal access tokens.
- Click Create.
- Name: Enter a descriptive name for the token.
- Permissions > Projects: Select Read.
- Permissions > Repositories: Select Read.
- Automated expiry: Select No.
- Click Create.
- Copy the token details to finish the integration in Spacelift.
Copy details into Spacelift»
Now that your Bitbucket Data Center access token has been created, return to the integration configuration screen in Spacelift.
- API host URL: Enter the URL of your Bitbucket server. This will likely use a format like:
https://bitbucket.<myorganization>.com
- User facing host URL: Enter the URL that will be shown to the user and displayed in the Spacelift UI. This will be the same as the API host URL unless you are using VCS Agents.
- Username: Enter the username for the Bitbucket account where you created the access token.
- Access token: Enter the access token that Spacelift will use to access your Bitbucket.
- Labels: Organize integrations by assigning labels to them.
- Description: A markdown-formatted free-form text field to describe the integration.
- Click Set up to save your integration settings.
Set up webhooks»
For every Bitbucket Data Center 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.
- On the Source code page, click the three dots next to the integration name.
- Click See details to find the webhook endpoint and webhook secret.
Configure webhooks in Bitbucket Data Center»
For each repository you want to use with Spacelift, you now need to add webhooks in Bitbucket Data Center.
- In Bitbucket Data Center, select the repository you are connecting to Spacelift.
- Navigate to Repository settings > Webhooks.
- Click Add webhook.
- Title: Enter a name for the webhook.
- URL: Paste the webhook endpoint from Spacelift.
- Secret: Paste the webhook secret from Spacelift.
- Status: Check Active.
- Triggers:
- Under Repository, check Push.
- Under Pull Request, check:
- Opened
- Source branch updated
- Modified
- Approved
- Unapproved
- Merged
- Comment added
- Click Save.
Warning
Don't forget to enter a secret when configuring your webhook. Bitbucket will allow you to create your webhook with no secret specified, but any webhook requests to Spacelift will fail without one configured.
Install Pull Request Commit Links app»
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.
✅ Step 1 of the LaunchPad is complete! Now you can connect your cloud account.