Repositories aus dem Bitbucket-Rechenzentrum in einem privaten Netzwerk erstellen
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Mit Cloud Build können Sie Trigger erstellen, um Builds aus Repositories zu erstellen, die in Bitbucket Data Center gehostet werden. So können Sie Builds als Reaktion auf Ereignisse wie Commit-Pushes oder Pull-Anfragen ausführen, die mit Ihrem Bitbucket Data Center-Repository verknüpft sind.
Auf dieser Seite wird erläutert, wie Sie die Triggerfunktion auf einer Bitbucket Data Center-Instanz aktivieren können, wenn Ihre Instanz in einem privaten Netzwerk gehostet wird.
Hinweise
Enable the Cloud Build, Secret Manager, and Compute Engine APIs.
Repositories aus Bitbucket Data Center in einem privaten Netzwerk erstellen
Wenn Ihre Bitbucket Data Center-Instanz in einem privaten Netzwerk gehostet wird und nicht über eine öffentliche Internetverbindung erreichbar ist, müssen Sie eine private Verbindung zwischen Ihrem VPC-Netzwerk und dem Netzwerk des Diensterstellers herstellen.
Außerdem benötigen Sie einen privaten Pool, um in einem privaten Netzwerk zu erstellen.
So erstellen Sie einen Bitbucket Data Center-Trigger für Builds in einem privaten Netzwerk:
Erstellen Sie eine private Verbindung zwischen dem VPC-Netzwerk und dem Netzwerk des Diensterstellers, indem Sie die folgenden Schritte ausführen:
Damit das VPC-Netzwerk mit Cloud Build verwendet werden kann, darf Ihre Präfixlänge maximal /23 sein, z. B. /22, /21.
Sie können den Bereich mit der CIDR-Notation (Classless Inter-Domain Routing) im Format STARTING_IP/SUBNET_PREFIX_SIZE angeben. 192.0.2.0/24 hat beispielsweise eine Präfixlänge von 24. Die ersten 24 Bits des IP-Bereichs werden als Subnetzmaske (192.0.2.0) verwendet, während die möglichen Hostadressen von 192.0.2.0 bis 192.0.2.255 reichen.
Stellen Sie eine private VPC-Netzwerkverbindung zwischen Ihrem VPC-Netzwerk und Google Cloudher. Weitere Informationen finden Sie unter Private Verbindung erstellen.
Wenn Sie für Ihre Bitbucket Data Center-Instanz DNS konfiguriert haben, müssen Sie Ihre DNS-Zone manuell bei unserem Dienstanbieter verbinden. Weitere Informationen finden Sie unter Private DNS-Zonen für Dienstersteller freigeben.
Optional: Wenn Sie keine private Verbindung von Ihrem Cloud-Projekt aus erstellen möchten, können Sie eine freigegebene VPC einrichten und Ihr Cloud-Projekt stattdessen dieses Netzwerk verwenden lassen, wenn Ihr Projekt Teil einer Organisation ist. Sie benötigen die freigegebene VPC für das Peering mit dem Netzwerk trotzdem.
Der Bitbucket Data Center-Trigger ruft jetzt gemäß Ihrer Konfiguration automatisch Builds auf Ihrer Bitbucket Data Center-Instanz auf. Informationen zum Ausführen von Builds mit einem privaten Pool finden Sie unter Builds in einem privaten Pool ausführen.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-01 (UTC)."],[[["\u003cp\u003eCloud Build can trigger builds from Bitbucket Data Center repositories in response to events like commit pushes or pull requests.\u003c/p\u003e\n"],["\u003cp\u003eFor Bitbucket Data Center instances hosted in a private network, a private connection between the VPC and the service producer network is required.\u003c/p\u003e\n"],["\u003cp\u003eBuilding in a private network requires the use of a private pool in addition to the private connection.\u003c/p\u003e\n"],["\u003cp\u003eConnecting a Bitbucket Data Center host and repository are necessary steps to set up these automated builds in a private network.\u003c/p\u003e\n"],["\u003cp\u003eTo complete the setup, a Bitbucket Data Center trigger must be created to automatically initiate builds based on the specific configurations.\u003c/p\u003e\n"]]],[],null,["# Build repositories from Bitbucket Data Center in a private network\n\n1st gen 2nd gen\n\nCloud Build enables you to create triggers to build from repositories\nhosted on [Bitbucket Data Center](https://confluence.atlassian.com/bitbucketserver/bitbucket-data-center-and-server-documentation-776639749.html),\nallowing you to execute builds in response to events such as commit pushes or\npull requests associated with your Bitbucket Data Center repository.\n\nThis page explains how you can enable trigger functionality on a\nBitbucket Data Center instance if your instance is hosted in a private network.\n\nBefore you begin\n----------------\n\n-\n\n\n Enable the Cloud Build, Secret Manager, and Compute Engine APIs.\n\n\n [Enable the APIs](https://console.cloud.google.com/flows/enableapi?apiid=cloudbuild.googleapis.com,secretmanager.googleapis.com,compute.googleapis.com&redirect=https://cloud.google.com/build/docs/automating-builds/bitbucket/connect-host-bitbucket-data-center)\n\n\u003c!-- --\u003e\n\n- Follow the instructions to [connect a Bitbucket Data Center host](/build/docs/automating-builds/bitbucket/connect-host-bitbucket-data-center).\n- Follow the instructions to [connect a Bitbucket Data Center repository](/build/docs/automating-builds/bitbucket/connect-repo-bitbucket-data-center).\n\nBuild repositories from Bitbucket Data Center in a private network\n------------------------------------------------------------------\n\nIf your Bitbucket Data Center instance is hosted in a private network and not\nreachable over a public internet connection, you must create a private\nconnection between your VPC network and the\n[service producer network](/../vpc/docs/private-services-access#service_producer_network).\nYou also need a [private pool](/build/docs/private-pools/private-pools-overview)\nto build in a private network.\n\nTo create a Bitbucket Data Center trigger to build in a private network:\n\n1. Create a private connection between the VPC network\n and your service producer network by completing the following steps:\n\n 1. [Create a new VPC network](/../vpc/docs/create-modify-vpc-networks#create-custom-network) or [select an existing VPC network](https://console.cloud.google.com/networking/networks/list).\n\n | **Note:** You must configure your VPC network to have access to your Bitbucket Data Center instance in a private network.\n 2. [Allocate a named IP range in the VPC network](/vpc/docs/configure-private-services-access#allocating-range) for your peered network.\n\n 3. [Allocate an internal IP range in the VPC](/vpc/docs/configure-private-services-access#allocating-range) that the Cloud Build\n producer network can use to allocate to VMs maintaining a connection\n with private repositories.\n\n To use the VPC network with Cloud Build, your\n prefix length must be `/23` or lower, such as `/22`, `/21`.\n\n You can specify the range using the Classless Inter-Domain Routing (CIDR)\n routing notation in the format `STARTING_IP/SUBNET_PREFIX_SIZE`. For example,\n `192.0.2.0/24` has a prefix length of 24. The first 24 bits of the IP range\n are used as the subnet mask (`192.0.2.0`) while the possible hosts addresses\n range from `192.0.2.0` to `192.0.2.255`.\n | **Note:** The value of your prefix length must not exceed `/29`. If no value is specified for the range, a default value of `/24` is automatically assigned. If no value is specified for the prefix length, IP addresses are automatically assigned within the peered VPC network.\n 4. Establish a VPC network private connection between your VPC network and Google Cloud. To learn more, see [Creating a private connection](/../vpc/docs/configure-private-services-access#creating-connection).\n\n 5. If you have DNS configured for your Bitbucket Data Center instance, you need to manually peer your DNS zone to our service provider. To learn\n more, see the [Sharing private DNS zones with service producers](/../vpc/docs/configure-private-services-access#dns-peering).\n\n 6. Optional: If you don't want to create a private connection from your Cloud project,\n you can set up a [Shared VPC](/../vpc/docs/provisioning-shared-vpc) and have your Cloud project use that network instead if your project is part of an organization. You will still need the Shared VPC to be peered to the network.\n\n2. Use [private pools](/build/docs/private-pools/private-pools-overview)\n to run your builds. If you have not created a private pool,\n see [create a new private pool](/build/docs/private-pools/create-manage-private-pools).\n\n3. [Connect a Bitbucket Data Center host](/build/docs/automating-builds/bitbucket/connect-host-bitbucket-data-center).\n\n4. [Connect a Bitbucket Data Center repository](/build/docs/automating-builds/bitbucket/connect-repo-bitbucket-data-center).\n\n5. [Create a Bitbucket Data Center trigger](/build/docs/automating-builds/bitbucket/build-repos-from-bitbucket-data-center)\n to build repositories hosted on a Bitbucket Data Center instance.\n\nYour Bitbucket Data Center trigger will now automatically invoke builds on\nyour Bitbucket Data Center instance based on your configuration. To learn how to\nrun builds using a private pool, see\n[Running builds in a private pool](/build/docs/private-pools/run-builds-in-private-pool).\n\nWhat's next\n-----------\n\n- Learn how to [create and manage build triggers](/build/docs/automating-builds/create-manage-triggers).\n- Learn how to [perform blue/green deployments on Compute Engine](/build/docs/deploying-builds/deploy-compute-engine)."]]