Cloud Build repositories

Cloud Build lets you create and manage connections to source code repositories using the Google Cloud console. You can create and manage connections using Developer Connect or Cloud Build repositories (2nd gen). With Cloud Build repositories (2nd gen), you can additionally configure repositories programmatically without the Google Cloud console and independently without a trigger.

This page provides an overview of Cloud Build repositories (2nd gen) and repositories linked through Developer Connect.

Connect to source providers using Developer Connect

Developer Connect lets you connect non-Google products or non-Google developer tools to Google Cloud using standardized steps and apps. You can configure Cloud Build to use a repository linked to a Developer Connect connection and then create triggers to build from the linked repositories. You can invoke builds on commits and pull requests.

Developer Connect can by used to connect to the following providers:

For more information about Developer Connect, see the Developer Connect overview .

Connect to providers using Cloud Build repositories (2nd gen)

With Cloud Build repositories (2nd gen), you can create and manage repository connections programmatically. You can set up a single connection for a repository and use Secret Manager secrets from that connection to programmatically set up additional connections across regions and projects. You can also set up connections using Terraform, in addition to the Google Cloud console, gcloud command-line tool, and the API. You must create a host connection prior to linking repositories when using Cloud Build repositories (2nd gen).

Cloud Build repositories (2nd gen) can be used with the following providers:

You can invoke builds on commits and pull requests. You can also invoke builds manually , on a Pub/Sub topic , or on an incoming webhook event .

Repository capabilities

The following table outlines capabilities associated with Cloud Build 2nd gen repositories and with repositories linked through Developer Connect.

Capabilities Cloud Build repositories (2nd gen) Developer Connect repositories
You can build in response to branch pushes, tag pushes, or pull request events.
Yes Yes
You can create a manual trigger
Yes No
You can create a Pub/Sub trigger
Yes No
You can create a webhook trigger
Yes No
You can create a single connection for a repository and use authentication from that connection to set up additional connections
Yes Yes
You can connect repositories from GitHub and GitHub Enterprise
Yes Yes
You can connect repositories from GitLab and GitLab Enterprise Edition
Yes Yes
You can connect repositories from Bitbucket Data Center and Bitbucket Cloud
Yes Yes
You can connect repositories from Cloud Source Repositories
No No
You can link repositories without creating a host connection
No No
You can create repository connections using gcloud
Yes Yes
You can create and automate repository connections using Terraform
Yes, except for Bitbucket Data Center and Bitbucket Cloud No
Your host connections and link repositories must exist in a particular region
Yes Yes

Specifying repositories as dependencies

By default, one of the following is used as the repository for the build:

  • The repository that triggers a build, if you're using a trigger

  • The repository that you specify using gcloud builds submit

However, you can specify repositories explicitly as dependencies , including the main source code repositories and any others your build depends on.

Learn more .

What's next

Create a Mobile Website
View Site in Mobile | Classic
Share by: