Bitbucket Server Integration

🚧

Note

Bitbucket Server is only supported on env0 Organizations signed up for our Self-Hosted Agent.

Minimum supported version: BitBucket Server v7.6

Initial Bitbucket Server Setup

For env0 to be able to clone your code and post back commit statuses when running Plan on Pull Request you need to provide it with an access token with write permissions.

This only needs to be done once for your Organization.

  1. Create a Personal access token on your Bitbucket Server.
  • We recommend creating the token for a bot user - as that is the user that will post back commit statuses and comments.
  • The user must have access to each repository you would like to be able to use with env0.
  • The token must have “Repository write” permissions.
  1. Encode the personal access token, and the username it was generated for, in the format of username:token - in base64. The encoded value should be used in the agent installation process as a helm value - bitbucketServerCredentialsEncoded. Check out our Self-Hosted K8S agent docs for more information.
  2. Install/update the agent with the new value

Webhooks Integration

Adding Webhooks is required in order to support Continuous Deployment and our Plan on Pull Request features on Bitbucket Server.

  1. Open your repository page in Bitbucket Server.
  2. Click on the settings icon.
  3. Enter the Webhooks page.
  4. Click on the "Create webhook" button.
  5. Give it a name, like "env0 integration".
  6. Copy & Paste the URL and Secret values from the env0 Template creation page.
  7. Mark ONLY Repository Push and Pull Request Opened and Source branch updated, as shown in the picture below.
  8. Make sure the webhook is marked as Active.
  9. Click on the Create button.
2052

BBS webhook creation