Information for: DEVELOPERS   PARTNERS   SUPPORT

Configuring the GitHub to pipelines client connection

Use the procedures on this page to control the connection between your GitHub repository and the optional pipelines command-line client. If you prefer to use your web browser to connect Cloud Platform to GitHub, see Connecting an application to an external Git repo.

Requirements

To configure the pipelines client integration with GitHub (both to connect and disconnect), you must have the following items:

For information about obtaining these items from GitHub, see Obtaining required GitHub information.

Connecting to GitHub

To configure the pipelines client to use a GitHub repository as the source, run the pipelines github-connect command as a user with the necessary GitHub permission for the GitHub repository.

Use the following command to connect the pipelines client to GitHub:

pipelines github-connect --application-id=[Acquia app ID] [GitHub user/GitHub repo-name] [GitHub token]

where

  • [Acquia app ID] is your Cloud Platform application ID.

  • [GitHub user/GitHub repo-name] is your GitHub user name and the name of the GitHub repository that will be the source repository for build jobs. You can find this in GitHub by selecting the repository and looking in the URL bar or on the repository’s main page.

    Finding your GitHub user name and repository name

  • [GitHub token] is a GitHub personal access token that you generate.

After you have run pipelines github-connect, the GitHub repository that you specify in pipelines github-connect becomes the default source repository for pipelines build jobs.

Each time that you use GitHub to create or reopen a pull request, push a commit, or push a tag, Cloud Platform runs the pipelines start command using the build definition file in the GitHub repository, and commits the build artifact to your Cloud Platform repository.

GitHub webhooks and deploy keys

When you run pipelines github-connect, the pipelines client adds a webhook to your GitHub repository.

To view the webhook in GitHub:

  1. Go to your repository, and then click Settings.
  2. In the menu on the left side, click Webhooks.

The pipelines client also creates a deploy key in your GitHub repository, which gives the client permission to interact with your repository.

To see the deploy key in GitHub:

  1. Go to your repository, and then click Settings.
  2. In the menu on the left side, click Deploy keys.

Disconnecting from GitHub

To disconnect the pipelines client from a GitHub repository, run the following command:

pipelines github-disconnect --application-id=[Acquia app ID] [GitHub user/GitHub repo-name] [GitHub token]

where

  • [Acquia app ID] is your Cloud Platform application ID.
  • [GitHub user/GitHub repo-name] is your GitHub user name and the name of the GitHub repository that is the source repository for build jobs. You can find this in GitHub by selecting the repository and looking in the URL bar or on the repository’s main page.
  • [GitHub token] is a GitHub personal access token that you generate.

Disconnecting your GitHub repository from the pipelines client also removes the webhook and deploy key added by the connection of the two services.