Bitbucket Pipelines allows users to create flexible, user defined builds for their repositories. Code Climate is happy to offer support for Pipelines, and this document explains how to set up a Pipeline step that will notify Code Climate that new code is ready for analysis.
Bitbucket Pipelines is only supported for repositories added to Code Climate organizations, which requires a paid plan.
- Add your Bitbucket repository to Code Climate, following the steps in our Bitbucket integration doc
- Enable Pipelines in your Bitbucket repository, following the steps in this document from Atlassian
- Copy the
analyze-with-code-climate.bashfile from this example repository into your own
analyze-with-code-climate.bashto your Pipelines build configuration
- Add two environment variables to your Pipelines settings:
i. CODE_CLIMATE_API_KEY - you can find this under Integrations in your Organization's Settings:
ii. CODE_CLIMATE_REPO_ID - you can find this in the URL for your repo on Code Climate :
Once you've completed these steps, you'll be able to add Code Climate as a step in your Builds with the following example config:
``` pipelines: default: - step: script: - pip install -U tox - tox - ./analyze-with-code-climate.bash ```
And that’s it!
Updated less than a minute ago