SCM integrations

2 minute read

Create an SCM integration to connect the CloudBees platform to Bitbucket or GitHub repositories in the cloud. Users who must manage code repositories behind their own firewall can integrate Bitbucket Data Center repositories with the platform. Connect to Bitbucket services with access tokens, or to GitHub by installing a GitHub App.

Table 1. SCM integration types available in the platform
SCM provider Hosting Integration type

Cloud

Access token

Self-hosted

Access token

Cloud

GitHub App

Once you have a connected your source code to the platform, you can create a new component and set up a workflow.

For more information, refer to the following documentation:

Bitbucket

If you have an Atlassian Bitbucket repository in the cloud, you can use an access token to connect it to the platform.

To integrate with Bitbucket:

  1. Select an organization, and then select Configurations  Integrations.

  2. Select Create integration.

  3. Select Source code management.

  4. Select Bitbucket access token.

  5. Enter an integration Name (no spaces are allowed).

  6. (optional) Enter a Description.

  7. Enter your Token.

    Create repository access token
    Figure 1. An example Bitbucket access token with the appropriate permissions.

    The CloudBees platform requires only the following scopes from Bitbucket:

    • Repositories: Read and write

    • Pull requests: Read and write

    • Webhooks: Read and write

  8. (Optional) Select Test integration to check the connection.

  9. Select Submit.

Your Bitbucket account is connected to the platform.

Bitbucket Data Center

Enterprise teams who require an on-premises repository can use the Atlassian Bitbucket Data Center. You can connect Bitbucket Data Center to the platform using an access token.

To integrate with Bitbucket Data Center:

  1. Select an organization, and then select Configurations  Integrations.

  2. Select Create integration.

  3. Select Source code management.

  4. Select Bitbucket Data Center access token.

  5. Enter an integration Name (no spaces are allowed).

  6. (optional) Enter a Description.

  7. Enter your Bitbucket Data Center URL.

  8. Enter your Token.

    The CloudBees platform requires the following scopes from Bitbucket:

    • Repository admin permissions

    Refer to the Bitbucket Data Center HTTP access token documentation for more information.

  9. (Optional) Select Test integration to check the connection.

  10. Select Submit.

Your Bitbucket Data Center account is connected to the platform.

GitHub

If you have a GitHub repository in the cloud, you can connect it to the platform. The CloudBees platform requires that the integration to GitHub be made through the GitHub App registered by CloudBees.

To integrate your GitHub repository:

  1. Select an organization, and then select Configurations  Integrations.

  2. Select Create integration.

  3. Select Source code management.

  4. Select GitHub App.

  5. Enter an integration Name (no spaces are allowed).

  6. (Optional) Enter a Description.

  7. Select Install GitHub App. This action redirects you to GitHub.

  8. Select a GitHub account or GitHub organization to connect.

    You only can set up a single platform integration with a given GitHub account or organization. GitHub accounts and organizations are displayed in GitHub as follows:

    • Configure present: At least one repository is already connected to the platform.

    • Configure is not present: Available to connect to the platform.

    The integration name is automatically generated based on the GitHub organization name.

    Create environment
    Figure 2. Example GitHub App installation.
  9. Install and authorize All repositories, or Only select repositories, and select from the options.

  10. Select Install & Authorize.

The integration is connected and listed in the platform under Integrations.