Connect your Bitbucket Pipeline to Humanitec
This how to guide explains how to push the Docker images for your Bitbucket repositories to Humanitec using Bitbucket Pipelines.
Set up pipelines for the repository
For each repository whose image you want to push to Humanitec, you must have Bitbucket Pipelines enabled. If you don’t have Pipelines set up, then follow the instructions in the Atlassian documentation.
Add Humanitec token and snippet
- Log in to Humanitec.
- Click the profile icon in the top right.
- Select Organization Settings.
- Select the Images tab.
- Click the Bitbucket Pipelines button.
Follow the instructions that appear in the modal. Humanitec will provide you with an access token for connecting to Humanitec’s registry and a code snippet to add to your pipeline configuration to push the image.
First, add the token as a repository variable:
- Go to the repository you want to connect.
- Go to Settings, and then go to Pipelines > Repository variables.
- Create a variable called
HUMANITEC_TOKEN, and paste the token from the modal as the value.
Click Next to perform the second step:
- Copy the snippet from the modal and add it to the end of your
- Commit the changes and initiate your pipeline. If the build is successful, your image will appear in the images list on Humanitec.
Lern more about the official Humanitec Pipe on Bitbucket: Build and push to Humanitec.