Beanstalk

Code Climate supports Beanstalk-hosted repositories. This article explains the setup​ process.

You can add both private and public Beanstalk repositories to Code Climate. However, all Beanstalk repositories must be added to Code Climate organizations, which requires a paid plan. This means if a repository is open-source in Beanstalk, it will be private in Code Climate.

You must be in an organization's Owners group to perform the actions described in this article.

How To

  1. In Beanstalk, from your repository's Activity page, locate the URI in the top-right corner and change the protocol selector to SSH. Copy the URI to your clipboard.

We do not currently support HTTPS for Beanstalk-hosted repositories.

  1. From your Code Climate Dashboard, within the organization you want to add the repository to, navigate to the URI text box.

Tip: In most cases, you can get to this text box by clicking Add Repo, then clicking Manually add a Git repo by URL. That said, in other cases, the click-by-click process may differ. While navigating, you may be prompted to enter an organization name.

  1. Enter the repository's URI.
  1. Optional: If you don't want the branch named master set as the default branch, click Change and enter a different branch name.
  1. Click Add Repo.
  2. Click the "copy to clipboard" icon to copy your new public SSH key to your clipboard.
  1. Back in Beanstalk, click Add SSH Key under your repository's URI.
  1. Click Add public key.
  1. Paste the SSH key into the Public SSH Key field.
  2. Click Add Key.
  1. Back in Code Climate, click This Deploy Key Is In Place.
  1. Code Climate will begin analyzing your repository right away. You'll see a "processing" indicator until our analysis is finished (which is usually within 5-15 minutes). Your Feed page will be empty until there's a new commit for us to review and until we find something worth telling you about.

Webhook

To complete your repository setup, you'll want to install our webhook. This hook is what notifies us of certain events happening in your repository, including commits made to your default branch. When we receive the notification, we'll run a new analysis on the spot.

If you don't install our webhook, we'll check for new commits on a poll.

  1. From your Beanstalk repository's Activity page, click Settings.
  1. Click Integration.
  1. Scroll down and click Webhooks Classic.
  1. Click Activate integration.
  1. Paste the following into the URL field: https://codeclimate.com/api/repos/repo_id/refresh?api_token=api_token. In this URL:
    • Replace repo_id with the ID listed in the browser's URL bar when viewing the repository Feed page.
    • Replace api_token with the token listed in the organization's Settings menu, in the Integrations tab. When looking for this token, ensure you are not viewing a repository’s Integrations tab -- since API tokens live at the organization-level, it is accessed in your organization’s Integrations tab.
  2. Click Next Step.
  1. Click Activate. Your Beanstalk repository will now trigger a new analysis automatically each time you push a commit to your default branch.

Beanstalk