借助 Developer Connect,您可以 Google Cloud 通过标准化步骤和应用将非 Google 产品或非 Google 开发者工具连接到 Google 产品或服务。您可以配置 Cloud Build,将代码库关联到 Developer Connect 主机连接,然后创建触发器以从关联的代码库进行构建。您可以基于提交和拉取请求调用构建。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[[["\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 repositories\n\nCloud Build lets you create and manage connections to source\ncode repositories using the Google Cloud console. You can create and manage\nconnections using Cloud Build repositories (1st gen) 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:\nCloud Build repositories (1st gen), Cloud Build\nrepositories (2nd gen), and repositories linked through\nDeveloper Connect.\n\nCloud Build repositories (1st gen)\n----------------------------------\n\nCloud Build repositories (1st gen) offers flexibility by enabling you\nto create connections to several source code management providers:\n\n- [GitHub](/build/docs/automating-builds/github/connect-repo-github)\n- [GitHub Enterprise](/build/docs/automating-builds/github/connect-host-github-enterprise)\n- [Bitbucket Server](/build/docs/automating-builds/bitbucket/connect-host-bitbucket-server)\n- [Bitbucket Data Center](/build/docs/automating-builds/bitbucket/connect-host-bitbucket-data-center)\n\nYou can also build repositories from [GitLab](/build/docs/automating-builds/gitlab/build-repos-from-gitlab) and [Bitbucket Cloud](/build/docs/automating-builds/bitbucket/build-repos-from-bitbucket-cloud) using webhook events.\n\nYou must create a host connection prior to linking repositories when using the\nGitHub Enterprise, GitLab Enterprise Edition, Bitbucket Server, or Bitbucket\nData Center integration.\n\nYou can create non-regional (`global`) or regional triggers. You can also invoke\nbuilds [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\nTerraform support and connection setup using the `gcloud` command-line tool\nis not available for Cloud Build repositories (1st gen).\n\nCloud Build repositories (2nd gen)\n----------------------------------\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\nCloud Build repositories for Developer Connect\n----------------------------------------------\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 link a repository to a\nDeveloper Connect host connection and then create triggers to\nbuild from the linked repositories. You can invoke builds on commits and pull\nrequests.\n\nDeveloper Connect can connect to repositories from the following\nproviders:\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\nCloud Build repository capabilities\n-----------------------------------\n\nThe following table outlines capabilities associated with Cloud Build\n1st and 2nd gen repositories, and with repositories linked through\nDeveloper Connect.\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---------------------------------------\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\nGitLab on Google Cloud\n----------------------\n\n|\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nIf you use GitLab as your source code repository, you can also use\n[GitLab continuous integration (CI)](https://docs.gitlab.com/ee/ci/) and\n[Google-managed GitLab CI/CD components](https://gitlab.com/google-gitlab-components)\nin [GitLab pipelines](https://docs.gitlab.com/ee/ci/pipelines/) to build and\ndeploy your workloads to Google Cloud.\n\nTry the\n[end-to-end tutorial](https://docs.gitlab.com/ee/tutorials/set_up_gitlab_google_integration/)\nfor using GitLab with Google Cloud.\n\nFor more information, see the [GitLab on Google Cloud overview](/docs/gitlab).\n\nWhat's next\n-----------\n\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)."]]