Stay organized with collectionsSave and categorize content based on your preferences.
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:
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,gcloudcommand-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:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eCloud Build offers two repository connection options: 1st gen, which supports various providers like GitHub, GitHub Enterprise, Bitbucket, and allows connections without a host connection, and 2nd gen, which enhances programmatic control and Terraform support.\u003c/p\u003e\n"],["\u003cp\u003eCloud Build repositories (2nd gen) uniquely supports GitLab and GitLab Enterprise Edition in addition to GitHub and Bitbucket, and allows setting up additional connections using Secret Manager from a single connection.\u003c/p\u003e\n"],["\u003cp\u003eBoth Cloud Build repository generations enable builds triggered by branch pushes, tag pushes, pull requests, manual triggers, Pub/Sub, and webhook events.\u003c/p\u003e\n"],["\u003cp\u003eCloud Build repositories (2nd gen) provides the option to create and automate repository connections using Terraform, the Google Cloud console, the \u003ccode\u003egcloud\u003c/code\u003e command-line tool, or the API.\u003c/p\u003e\n"],["\u003cp\u003eCloud Source Repositories will not be available to new customers as of June 17th, 2024, but organizations that have previously used it will not be affected by this change.\u003c/p\u003e\n"]]],[],null,["Cloud Build lets you create and manage connections to source\ncode repositories using the Google Cloud console. You can create and manage\nconnections using Developer Connect or\nCloud Build repositories (2nd gen). With Cloud Build\nrepositories (2nd gen), you can additionally configure repositories\nprogrammatically without the Google Cloud console and independently without a\ntrigger.\n\nThis page provides an overview of Cloud Build repositories (2nd gen)\nand repositories linked through Developer Connect.\n\nConnect to source providers using Developer Connect\n\nDeveloper Connect lets you connect non-Google products or non-Google\ndeveloper tools to Google Cloud using standardized steps and apps. You\ncan configure Cloud Build to use a repository linked to a\nDeveloper Connect connection and then create triggers to build from\nthe linked repositories. You can invoke builds on commits and pull requests.\n\nDeveloper Connect can by used to connect to the following providers:\n\n- [GitHub](/developer-connect/docs/connect-github-repo)\n- [GitHub Enterprise](/developer-connect/docs/connect-github-enterprise)\n- [GitLab](/developer-connect/docs/connect-gitlab)\n- [GitLab Enterprise Edition](/developer-connect/docs/connect-gitlab-enterprise)\n- [Bitbucket Data Center](/developer-connect/docs/connect-bitbucket-dc)\n- [Bitbucket Cloud](/developer-connect/docs/connect-bitbucket-cloud)\n\nFor more information about Developer Connect, see the\n[Developer Connect overview](/developer-connect/docs/overview).\n\nConnect to providers using Cloud Build repositories (2nd gen)\n\nWith Cloud Build repositories (2nd gen), you can create and manage\nrepository connections programmatically. You can set up a single connection for\na repository and use Secret Manager secrets from that connection to\nprogrammatically set up additional connections across regions and projects. You\ncan also set up connections using Terraform, in addition to the\nGoogle Cloud console, `gcloud` command-line tool, and the API. You must create a\nhost connection prior to linking repositories when using Cloud Build\nrepositories (2nd gen).\n\nCloud Build repositories (2nd gen) can be used with the following\nproviders:\n\n- [GitHub](/build/docs/automating-builds/github/connect-repo-github)\n- [GitHub Enterprise](/build/docs/automating-builds/github/connect-host-github-enterprise)\n- [GitLab](/build/docs/automating-builds/gitlab/connect-host-gitlab)\n- [GitLab Enterprise Edition](/build/docs/automating-builds/gitlab/connect-host-gitlab-enterprise-edition)\n- [Bitbucket Data Center](/build/docs/automating-builds/bitbucket/connect-host-bitbucket-data-center?2nd-gen)\n- [Bitbucket Cloud](/build/docs/automating-builds/bitbucket/connect-host-bitbucket-cloud)\n\nYou can invoke builds on commits and pull requests. You can also invoke builds\n[manually](/build/docs/manually-build-code-source-repos), on a\n[Pub/Sub topic](/build/docs/automate-builds-pubsub-events),\nor on an incoming [webhook event](/build/docs/automate-builds-webhook-events).\n| **Note:** Cloud Build repositories (1st gen) is superseded by 2nd gen, but is available as a legacy option.\n\nRepository capabilities\n\nThe following table outlines capabilities associated with Cloud Build\n2nd gen repositories and with repositories linked through\nDeveloper Connect.\n\n| **Capabilities** | **Cloud Build repositories (2nd gen)** | **Developer Connect repositories** |\n|----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------|------------------------------------|\n| You can build in response to branch pushes, tag pushes, or pull request events. | Yes | Yes |\n| You can create a manual trigger | Yes | No |\n| You can create a Pub/Sub trigger | Yes | No |\n| You can create a webhook trigger | Yes | No |\n| You can create a single connection for a repository and use authentication from that connection to set up additional connections | Yes | Yes |\n| You can connect repositories from GitHub and GitHub Enterprise | Yes | Yes |\n| You can connect repositories from GitLab and GitLab Enterprise Edition | Yes | Yes |\n| You can connect repositories from Bitbucket Data Center and Bitbucket Cloud | Yes | Yes |\n| You can connect repositories from Cloud Source Repositories | No | No |\n| You can link repositories without creating a host connection | No | No |\n| You can create repository connections using gcloud | Yes | Yes |\n| You can create and automate repository connections using Terraform | Yes, except for Bitbucket Data Center and Bitbucket Cloud | No |\n| Your host connections and link repositories must exist in a particular region | Yes | Yes |\n\n| **Caution:** Effective June 17, 2024, Cloud Source Repositories isn't available\n| to new customers. If your organization hasn't\n| previously used Cloud Source Repositories, you can't enable the API or use\n| Cloud Source Repositories. New projects not connected to an organization can't enable the\n| Cloud Source Repositories API. Organizations that have used Cloud Source Repositories prior to\n| June 17, 2024 are not affected by this change.\n\nSpecifying repositories as dependencies\n\nBy default, one of the following is used as the repository for the build:\n\n- The repository that triggers a build, if you're using a\n [trigger](/build/docs/triggers)\n\n- The repository that you specify using `gcloud builds submit`\n\nHowever, you can\n[specify repositories explicitly as dependencies](/build/docs/building/manage-dependencies),\nincluding the main source code repositories and any others your build depends\non.\n\n[Learn more](/build/docs/building/manage-dependencies).\n\nWhat's next\n\n- Find out more about [Developer Connect](/developer-connect/docs/overview).\n- Learn how to [connect a GitHub host and repository](/build/docs/automating-builds/github/connect-repo-github).\n- Learn how to [connect a GitHub Enterprise host](/build/docs/automating-builds/github/connect-host-github-enterprise).\n- Learn how to [connect a GitHub Enterprise repository](/build/docs/automating-builds/github/connect-repo-github-enterprise).\n- Learn how to [connect a GitLab host](/build/docs/automating-builds/gitlab/connect-host-gitlab).\n- Learn how to [connect a GitLab repository](/build/docs/automating-builds/gitlab/connect-repo-gitlab).\n- Learn how to [connect a GitLab Enterprise Edition host](/build/docs/automating-builds/gitlab/connect-host-gitlab-enterprise-edition).\n- Learn how to [connect a GitLab Enterprise Edition repository](/build/docs/automating-builds/gitlab/connect-host-gitlab-enterprise-edition).\n- Learn how to [manually build code in source repositories](/build/docs/manually-build-code-source-repos).\n- Learn how to [automate builds in response to webhook events](/build/docs/automate-builds-webhook-events).\n- Learn how to [automate builds in response to Pub/Sub events](/build/docs/automate-builds-pubsub-events)."]]