Cloud Build repositories

Cloud Build lets you create and manage connections to sourcecode repositories using the Google Cloud console. You can create and manageconnections using Developer Connect orCloud Build repositories (2nd gen). With Cloud Buildrepositories (2nd gen), you can additionally configure repositoriesprogrammatically without the Google Cloud console and independently without atrigger.

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-Googledeveloper tools to Google Cloud using standardized steps and apps. Youcan configure Cloud Build to use a repository linked to aDeveloper Connect connection and then create triggers to build fromthe 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 theDeveloper Connect overview.

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

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

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

You can invoke builds on commits and pull requests. You can also invoke buildsmanually, on aPub/Sub topic,or on an incomingwebhook event.

Note: Cloud Build repositories (1st gen) is superseded by 2nd gen,but is available as a legacy option.

Repository capabilities

The following table outlines capabilities associated with Cloud Build2nd gen repositories and with repositories linked throughDeveloper Connect.

CapabilitiesCloud Build repositories (2nd gen)Developer Connect repositories
You can build in response to branch pushes, tag pushes, or pull request events.YesYes
You can create a manual triggerYesNo
You can create a Pub/Sub triggerYesNo
You can create a webhook triggerYesNo
You can create a single connection for a repository and use authentication from that connection to set up additional connectionsYesYes
You can connect repositories from GitHub and GitHub EnterpriseYesYes
You can connect repositories from GitLab and GitLab Enterprise EditionYesYes
You can connect repositories from Bitbucket Data Center and Bitbucket CloudYesYes
You can connect repositories from Cloud Source RepositoriesNoNo
You can link repositories without creating a host connectionNoNo
You can create repository connections using gcloudYesYes
You can create and automate repository connections using TerraformYes, except for Bitbucket Data Center and Bitbucket CloudNo
Your host connections and link repositories must exist in a particular regionYesYes

Caution: Effective June 17, 2024, Cloud Source Repositories isn't available to new customers. If your organization hasn't previously used Cloud Source Repositories, you can't enable the API or use Cloud Source Repositories. New projects not connected to an organization can't enable the Cloud Source Repositories API. Organizations that have used Cloud Source Repositories prior to June 17, 2024 are not affected by this change.

Specifying repositories as dependencies

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

However, you canspecify repositories explicitly as dependencies,including the main source code repositories and any others your build dependson.

Learn more.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.