Configure For Bitbucket Pipelines

Configuration

To configure a project for Bitbucket pipelines you need to add the BuildBasis Bitbucket Pipe to your project.

Prerequisite:

Configuring any project to report data to BuildBasis requires an API key. You can view your organization’s API key in the BuildBasis Dashboard API Page.

Steps:

1.) Set a BUILDBASIS_API_KEY environment variable in Bitbucket to an api key from your BuildBasis dashboard.

2.) Open your bitbucket-pipelines.yml file for your project.

3.) Add the BuildBasis pipe towards the start of your build.

- pipe: docker://buildbasis/buildbasis-bitbucket-pipe:1.0.0
  variables: 
    BUILDBASIS_API_KEY: $BUILDBASIS_API_KEY

4.) Then add the BuildBasis pipe as part of the after-script:

after-script:
  - pipe: docker://buildbasis/buildbasis-bitbucket-pipe:1.0.0
    variables: 
      BUILDBASIS_API_KEY: $BUILDBASIS_API_KEY

5.) Run a pipeline and the project will be viewable within BuildBasis.

A complete example:

pipelines:
  default:
    - step:
        name: Pass
        script:
          - pipe: docker://buildbasis/buildbasis-bitbucket-pipe:1.0.0
            variables: 
              BUILDBASIS_API_KEY: $BUILDBASIS_API_KEY
          - gem install bundler
          - bundle install
          - bundle exec rspec
        after-script:
          - pipe: docker://buildbasis/buildbasis-bitbucket-pipe:1.0.0
            variables: 
              BUILDBASIS_API_KEY: $BUILDBASIS_API_KEY