vRealize Automation Code Stream provides a way to trigger a pipeline if a code change occurs in your GitHub, GitLab, or Bitbucket repository. The Git trigger uses a Git endpoint on the branch of the repository that you want to monitor. vRealize Automation Code Stream connects to the Git endpoint through a webhook.

To define a Git endpoint in vRealize Automation Code Stream, you select a project and enter the branch of the Git repository where the endpoint is located. The project groups the pipeline with the endpoint and other related objects. When you choose the project in your webhook definition, you select the endpoint and pipeline to trigger.
Note: If you define a webhook with your endpoint and you later edit the endpoint, you cannot change the endpoint details in the webhook. To change the endpoint details, you must delete and redefine the webhook with the endpoint. See How do I use the Git trigger in vRealize Automation Code Stream to run a pipeline.

Prerequisites

  • Verify that you can access the GitHub, GitLab, or Bitbucket repository to which you plan to connect.
  • Verify that you are a member of a project in vRealize Automation Code Stream. If you are not, ask a vRealize Automation Code Stream administrator to add you as a member of a project. See How do I add a project in vRealize Automation Code Stream.

Procedure

  1. Define a Git endpoint.
    1. Click Endpoints > New Endpoint.
    2. Select a project, and for the endpoint type select Git. Then, enter a name and description.
    3. If this endpoint is a business-critical component in your infrastructure, enable Mark as restricted.
    4. Select one of the supported Git server types.
    5. Enter the URL for the repository with the API gateway for the server in the path. For example, enter https://api.github.com/vmware-example/repo-example.
    6. Enter the branch in the repository where the endpoint is located.
    7. Select the Authentication type and enter the username for GitHub, GitLab, or BitBucket. Then enter the password, private token, or private key that goes with the username.
      • Password. Your password provides completes access to the repository. You can also create a variable for the password.

        Use secret variables to hide and encrypt sensitive information. Use restricted variable for strings, passwords, and URLs that must be hidden and encrypted, as well as to retrict use in executions. For example, use a secret variable for a password or URL. You can use secret and restricted variables in any type of task in your pipeline.

      • Private token. This token is Git-specific and provides access to a specific action. See https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html. You can also create a variable for the private token.
      • Private key. This SSH key is a private key that provides access to a specific repository. When a Git event occurs, vRealize Automation Code Stream uses this key to clone a repository. See https://help.github.com/articles/reviewing-your-ssh-keys/.
  2. Click Validate, and verify that the endpoint connects to vRealize Automation Code Stream.
    If it does not connect, correct any errors, then click Create.
    New endpoint for Git

What to do next

To learn more, review the other sections. See How do I use the Git trigger in vRealize Automation Code Stream to run a pipeline.