Cloud Build repositories Stay organized with collections Save and categorize content based on your preferences.
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.
| 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 |
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:
The repository that triggers a build, if you're using atrigger
The repository that you specify using
gcloud builds submit
However, you canspecify repositories explicitly as dependencies,including the main source code repositories and any others your build dependson.
What's next
- Find out more aboutDeveloper Connect.
- Learn how toconnect a GitHub host and repository.
- Learn how toconnect a GitHub Enterprise host.
- Learn how toconnect a GitHub Enterprise repository.
- Learn how toconnect a GitLab host.
- Learn how toconnect a GitLab repository.
- Learn how toconnect a GitLab Enterprise Edition host.
- Learn how toconnect a GitLab Enterprise Edition repository.
- Learn how tomanually build code in source repositories.
- Learn how toautomate builds in response to webhook events.
- Learn how toautomate builds in response to Pub/Sub events.
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.