Git Repositories

3 min read

Git Repo Integration #

Overview

This guide explains how to connect a Git repository to BuildPiper. Once a repository is added, BuildPiper can securely connect to it and clone the source code for builds. Git repo integration is the first step of service onboarding.

1. What Is Git Repo Integration? #

Git onboarding in BuildPiper means integrating your Git repository (such as GitHub, GitLab or Bitbucket) with the platform. Typically, a read-only access user is created and provided to BuildPiper. This lets BuildPiper securely connect to and clone the repository without making any changes to it.

BuildPiper supports the following Git providers:

• Bitbucket

• GitLab

• GitHub

Note: BuildPiper supports both cloud-based Git providers and self-hosted Git repositories.

Where It Fits in Service Onboarding #

Git repo integration is step 1 of the complete service onboarding workflow:

  1. 1

    Git Repo Integration (this guide)

  2. 2

    Service Configurations

  3. 3

    Environment Onboarding

  4. 4

    Configuration of build details

  5. 5

    Configuration of deploy details

  6. 6

    Initiating a service build

  7. 7

    Initiating a service deployment

Before You Begin #

Swipe horizontally to view all columns →
Item Why it is needed
Read-only Git user with credentials BuildPiper signs in to the Git provider with this user to read and clone the repository. Read-only access is enough, because BuildPiper does not change the repository.
Network connectivity The BuildPiper server must be able to reach the Git provider, whether it is a cloud service or a self-hosted server.
Repository URL The URL of the repository on the Git provider.
Access to the Integration menu The Git repo onboarding page is available from both the user portal and the admin portal.

2. Open Repo Integration #

  1. 1

    In the left navigation, click Integration.

  2. 2

    In the Integration menu, select Repo Integration. The Integrations: Code Repositories page opens.

  3. 3

    To configure a new Git repository, click + ADD REPO at the top right.

Figure 1: Integration menu and Add Repo button

Figure 1: Integration > Repo Integration > + ADD REPO

Note: The Git repo onboarding page is accessible from both the user portal and the admin portal.

The Code Repositories Page #

The page lists every Git repository already integrated with BuildPiper, 10 per page.

Swipe horizontally to view all columns →
Column What it shows
Name The repository name entered when it was added, with the provider icon.
Type The Git provider, for example GitHub.
URL The repository URL.
Status Connected when BuildPiper can reach the repository.
â‹® (row menu) Opens the actions for that repository.

Use the Provider and Repository filters, + MORE and CLEAR FILTERS to find a repository. The page controls at the bottom move between pages, and Go to Page Number jumps to a page.

3. Add a Git Repository #

Clicking + ADD REPO opens the Code Repos Integrations window. Select the Git provider that hosts your repository: Bitbucket, GitHub or GitLab.

Figure 2: Code Repos Integrations Git provider selector

Figure 2: Code Repos Integrations: select the Git provider

The Integration Settings form opens for the selected provider, for example Bitbucket Integration Settings. The fields are the same for Bitbucket, GitHub and GitLab. Fields marked with a red asterisk (*) are required.

Figure 3: Bitbucket Integration Settings connected example

Figure 3: Bitbucket Integration Settings form after a successful connection test

The GitHub Integration Settings form has the same fields.

Figure 4: GitHub Integration Settings connected example

Figure 4: GitHub Integration Settings form after a successful connection test

Form Fields #

Swipe horizontally to view all columns →
Field Required What to enter
Repo Name Yes A unique display name for the repository within BuildPiper (for example, emp-frontend-repo).
Select Secrets Yes The credential BuildPiper uses to authenticate with the Git provider. Select a pre-configured credential from the dropdown, or click + New Secret to add one. For details, see the Credential Management documentation.
Url Yes The URL of the repository, for example https://bitbucket.org/okts/liquibase_test.git. Valid URL appears above the field when the format is correct. The TEST CONNECTION button next to it verifies connectivity.
Select User Group whom you want to give View Permissions Yes The user groups allowed to view this repository integration. Type a group name and press Enter to add it.
Select User Group whom you want to give Write Permissions as well Yes The user groups allowed to modify this repository integration settings. Type a group name and press Enter to add it.

URL by Provider #

Swipe horizontally to view all columns →
Provider What to enter in Url
Bitbucket The specific endpoint for the repository (for example, https://bitbucket.org/okts/liquibase_test.git).
GitHub The full URL path to the GitHub repository (for example, https://github.com/OT-BUILDPIPER-MARKETPLACE/BP-NPM-STEP.git).
GitLab The full URL path to the GitLab repository.

Important: Use the read-only Git user for the secret, not a personal account with write access. BuildPiper only needs to read and clone the repository.

Test the Connection #

  1. 1

    Fill in Repo Name and Url.

  2. 2

    Select the secret in Select Secrets, or create one with + New Secret.

  3. 3

    Click TEST CONNECTION. BuildPiper tries to reach the repository at the URL with the selected secret. A green Connection Established banner appears when it succeeds.

  4. 4

    Select the user groups for view and write permissions.

Expected result: The connection test succeeds and the repository appears in the Code Repositories list with the status Connected. It can now be selected when configuring a service.

4. Outcome #

Once a repository is added and its connection test passes, it is listed on the Code Repositories page and can be selected in a service. The next step of service onboarding is Service Configuration.