Information for: DEVELOPERS   PARTNERS

Connecting pipelines to your GitHub repo

The pipelines feature included with Cloud Platform enables you to integrate your Acquia-hosted application with version control repositories hosted by GitHub.com.

Requirements

Before you connect Cloud Platform to your repository, ensure you meet the requirements for your repository, based on the following:

  • If you don’t already have a GitHub repository, sign in to your GitHub account, and then visit github.com/new to create a new repository from the GitHub interface.

  • If you have an existing repository, add GitHub as a new remote by modifying your project repository’s local clone with the following code (where [username] is your GitHub username and [project] is the name of your project):

    git remote add github [email protected]:[username]/[project].git
    git push github master
    

Procedure

To use the Cloud Platform interface to connect to your GitHub repository, complete the following steps:

Note

If you prefer to connect to your GitHub repository by using the command-line client, see Managing your pipelines from the command line.

  1. Sign in to Cloud Platform.

  2. Click the name of the application you want to connect to GitHub.

  3. In the left menu, click Pipelines. If your application doesn’t display a Pipelines link, contact Acquia Support.

  4. Click the More links icon CD Pipelines more links image and then click View application info.

  5. In the Connected repository information section, click the Configure link.

    Click Configure link image

  6. In the Select Source section, click the Choose source link.

    Configure Pipelines with Github repository image

  7. Click the Configure link for the Configure Pipelines with your GitHub repository section.

    Select GitHub image

  8. Click Connect to GitHub. Cloud Platform will connect to GitHub and display a confirmation page.

  9. Click the Authorize button in the GitHub interface to grant Cloud Platform access to your GitHub repository. Cloud Platform will display a page containing your environment’s pipelines information.

  10. Click Select GitHub repository.

  11. Select the repository to which you want to connect, and then click Continue.

Each time you use GitHub to create or reopen a pull request, push a commit, or push a tag, Cloud Platform executes the pipelines start command using the build definition file in the GitHub repository, and then commits the resulting build artifact, named pipelines-build-[BRANCHNAME], to your Cloud Platform repository.

Changing your webhook

If you want to change the webhook in use by your repository, complete the following steps:

Note

You can use the following process to also remove the webhook from your repo. In that case, skip the final step in the following procedure.

  1. Sign in to GitHub.

  2. Go to the following URL:

    https://github.com/[your_namespace]/[your_repo]/settings/hooks
    
  3. Delete the webhook associated with your application.

  4. Complete the steps in the earlier connection procedure to reinitialize your repository with the new Acquia application ID and GitHub repository name.

Next step

To operate, the Cloud Platform pipelines feature expects a file in YAML format named acquia-pipelines.yaml to exist in the root directory of your code repository. This build definition file has all the information required for pipelines to perform the build, including any variables required and the instructions used to perform the build.

For information about how to structure this file and what it should contain, see Creating and managing your build definition file.