# Bitbucket

With our CI integration to Bitbucket you can automatically upload your latest commits and pull requests to Debricked or whenever you run your pipeline. Just like with GitHub integration it just takes a few minutes to set up!

# Integrating using an access token

  • Start by generating an access token by following the instructions here. Copy the token so that you can use it in the next step.
  • Configure your DEBRICKED_TOKEN by heading over to your repository -> Repository settings -> Repository variables, see below. Paste in the access token from the previous step. Environment variables anim

Tip

Make sure to secure the token, so that it does not show in the logs.

  • Go to your repository and add the following (minimal working example) to your bitbucket-pipelines.yml file (if the file doesn't exist, create one):
image:
    name: atlassian/default-image:2

test: &test
    step:
        name: Test
        script:
            -   pipe: debricked/debricked-scan:1.3.1
                variables:
                    DEBRICKED_TOKEN: $DEBRICKED_TOKEN
                    # For all options, please check https://bitbucket.org/debricked/debricked-scan

pipelines:
    default:
        - <<: *test
  • Commit your changes to bitbucket-pipelines.yml and watch the CI run! Example output: Bitbucket example run

# Integrating with username and password

Note

We recommend using access tokens above to perform the integration. This is both more secure, and more reliable, since you can use different tokens for each integration, as well change your user password without affecting the integrations.

  • Configure your DEBRICKED_USERNAME (email) and DEBRICKED_PASSWORD variables by heading over to your repository -> Repository settings -> Repository variables, see animation above.

Tip

Make sure to at least mask the password, so that it does not show in the logs.

  • Go to your repository and add the following to your bitbucket-pipelines.yml file (if the file doesn't exist, create one):
image:
    name: atlassian/default-image:2

test: &test
    step:
        name: Test
        script:
            -   pipe: debricked/debricked-scan:1.3.1
                variables:
                    USERNAME: $DEBRICKED_USERNAME
                    PASSWORD: $DEBRICKED_PASSWORD
                    # For all options, please check https://bitbucket.org/debricked/debricked-scan

pipelines:
    default:
        - <<: *test
  • Commit your changes to bitbucket-pipelines.yml and watch the CI run!

For more information on Bitbucket Pipes, please visit https://bitbucket.org/product/features/pipelines. You can also take a look at our example repository (opens new window) which uses the Debricked pipe in the pipeline.