Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Sie können Cloud Deploy in einige der anderen Systeme einbinden, auf die Sie sich bei der Softwarebereitstellung verlassen. Auf dieser Seite wird beschrieben, wie Sie Cloud Deploy in Folgendes einbinden:
Testtool
Workflow-Management
Unter In CI-System einbinden erfahren Sie, wie Sie Cloud Deploy über Ihre CI-Pipeline aufrufen.
Hinweis
Die Anleitung auf dieser Seite setzt voraus, dass Sie bereits die folgenden Bedingungen erfüllen:
Sie können Cloud Deploy mit Pub/Sub verwenden, um Tests in Ihre Bereitstellungspipeline zu integrieren, sodass Sie die Version für Continuous Delivery automatisch hochstufen können.
ist der Name des Release. Dieser Wert ist erforderlich.
PIPELINE_NAME
ist der Name der Delivery-Pipeline, die diesen Release verwaltet. Dieser Wert ist erforderlich.
REGION
ist die Region, in der die Pipeline ausgeführt wird. Wenn Sie das Attribut deploy/region festgelegt haben, können Sie dieses Flag weglassen.
KEY=VALUE,...
ist eine Liste mit einem oder mehreren durch Kommas getrennten Schlüssel/Wert-Paarpaaren, die Informationen zu den Testergebnissen und andere Testinformationen enthalten können.
Beispiel:
Annotationen für das Rollout sind unveränderlich. Wenn Sie eine Statusannotation hinzufügen, können Sie diesen Status später nicht mehr für dasselbe Rollout aktualisieren.
Annotationen verwenden, um Zugriff auf Testergebnisse zu gewähren
Wenn die URL darauf erweist, dass auf die Testergebnisse zugegriffen werden kann, können Sie diese URL als Annotation bei einem Rollout mit dem Flag --annotations angeben.
Beispiel:
In die Workflow-Verwaltung von Drittanbietern einbinden
Cloud Deploy veröffentlicht operative Nachrichten in Pub/Sub.
Ihr Workflow-Managementtool kann diese Pub/Sub-Themen abonnieren und damit bestimmte Workflows auslösen.
Für Genehmigungen
Das Thema clouddeploy-approvals benachrichtigt Ihr System, wenn eine Genehmigung für einen Rollout erforderlich ist. Ihr externes Workflowsystem kann dann mit einem magischen Befehl die Genehmigung abrufen und dann gcloud deploy rollouts approve aufrufen.
Das Konto, das den Befehl rollouts approve ausgibt, muss die vordefinierte IAM-Rolle roles/clouddeploy.approver haben.
So richten Sie einen externen Genehmigungsworkflow ein:
Fügen Sie in die Definition für dieses Ziel requireApproval: true ein.
Wenn Sie die Nachrichten nutzen möchten, abonnieren Sie das Pub/Sub-Thema clouddeploy-approvals und richten Sie Ihr Workflow-Verwaltungssystem ein.
Wenn Ihr Workflow-Verwaltungssystem eine Nachricht aus dem Thema clouddeploy-approvals mit "Action": "Required" empfängt, wird ein Genehmigungsworkflow gestartet, der gemäß den Anforderungen Ihrer Organisation konfiguriert ist.
Die Nachricht enthält auch einen Verweis auf den zu genehmigenden Rollout im folgenden Format:
[[["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-08-17 (UTC)."],[[["\u003cp\u003eCloud Deploy can integrate with test tooling using Pub/Sub to automate release promotion upon successful deployment and testing.\u003c/p\u003e\n"],["\u003cp\u003eAnnotations on rollouts can be used to provide links to test results, offering a way to access testing information directly.\u003c/p\u003e\n"],["\u003cp\u003eCloud Deploy integrates with third-party workflow management systems through Pub/Sub, allowing for the automation of workflows, including approvals.\u003c/p\u003e\n"],["\u003cp\u003eBy subscribing to the \u003ccode\u003eclouddeploy-approvals\u003c/code\u003e topic, workflow management systems can trigger custom approval processes and manage the approval or rejection of rollouts.\u003c/p\u003e\n"],["\u003cp\u003eBefore performing any integrations, you must ensure that you have enabled the required APIs, defined at least one delivery pipeline and target, and have set up Pub/Sub notifications for \u003ccode\u003eclouddeploy-operations\u003c/code\u003e and \u003ccode\u003eclouddeploy-approvals\u003c/code\u003e topics.\u003c/p\u003e\n"]]],[],null,["# Integrating Cloud Deploy with other systems\n\nYou can integrate Cloud Deploy with some of the other systems you\nrely on for software delivery. This page describes how to integrate Cloud Deploy\nwith the following:\n\n- Test tooling\n- Workflow management\n\nSee [Integrating with your CI system](/deploy/docs/integrating-ci)\nto learn how to call Cloud Deploy from your CI pipeline.\n\nBefore you begin\n----------------\n\nThe instructions on this page assume you already meet the following conditions:\n\n- You have [enabled the applicable APIs](https://console.cloud.google.com/flows/enableapi?apiid=clouddeploy.googleapis.com,cloudbuild.googleapis.com,storage-component.googleapis.com,container.googleapis.com&redirect=https://cloud.google.com/deploy/docs/deploy-app-gke&_ga=2.88599711.504283000.1626992575-1788689322.1622287630)\n\n- You have at least one delivery pipeline [defined](/deploy/docs/config-file)\n and [registered](/deploy/docs/create-pipeline-targets#register_the_delivery_pipeline_and_targets)\n with Cloud Deploy.\n\n- You have at least one [target defined](/deploy/docs/config-files#target_definitions),\n and your delivery pipeline references that target.\n\n- You have [set up Pub/Sub notifications](/deploy/docs/subscribe-deploy-notifications)\n to receive notifications from the following topics:\n\n - `clouddeploy-operations`\n - `clouddeploy-approvals`\n\nIntegrating with automated testing\n----------------------------------\n\nYou can use Cloud Deploy with Pub/Sub to integrate testing\nwith your delivery pipeline, so you can promote the release automatically, for\ncontinuous delivery.\n\nYou can also use annotations on a rollout to provide a link to test results.\nFor more information, see [Using labels and annotations with Cloud Deploy](/deploy/docs/labels-annotations).\n\n### Using Pub/Sub to automate promotion\n\n1. Listen to [Pub/Sub messages](/deploy/docs/subscribe-deploy-notifications)\n from the `clouddeploy-operations` topic.\n\n The message contains the following attributes:\n - `Action: SUCCEED`\n - `ResourceType: Rollout`\n - `Resource: projects/.../locations/.../deliveryPipelines/.../releases/.../rollouts/...`\n2. When you receive a notification that deployment has succeeded, run your tests\n on your deployed application.\n\n3. When your tests succeed, call Cloud Deploy to automatically\n promote to the next stage:\n\n gcloud deploy releases promote \u003cvar label=\"release name\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eRELEASE_NAME\u003c/span\u003e\u003c/var\u003e \\\n --delivery-pipeline=\u003cvar label=\"pipeline name\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ePIPELINE_NAME\u003c/span\u003e\u003c/var\u003e \\\n --region=\u003cvar label=\"region\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eREGION\u003c/span\u003e\u003c/var\u003e \\\n --annotations=\u003cvar label=\"annotations\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eKEY\u003c/span\u003e\u003cspan class=\"devsite-syntax-o\"\u003e=\u003c/span\u003e\u003cspan class=\"devsite-syntax-n\"\u003eVALUE\u003c/span\u003e\u003cspan class=\"devsite-syntax-p\"\u003e,...\u003c/span\u003e\u003c/var\u003e\n\n where:\n - \u003cvar label=\"release name\" translate=\"no\"\u003eRELEASE_NAME\u003c/var\u003e\n\n is the name of the release. This value is required.\n - \u003cvar label=\"pipeline name\" translate=\"no\"\u003ePIPELINE_NAME\u003c/var\u003e\n\n is the name of the delivery pipeline managing this release. This value is\n required.\n - \u003cvar label=\"region\" translate=\"no\"\u003eREGION\u003c/var\u003e\n\n is the region in which the pipeline is running. If you've set the property\n `deploy/region`, you can omit this flag.\n - \u003cvar label=\"annotations\" translate=\"no\"\u003eKEY=VALUE,...\u003c/var\u003e\n\n is a list of one or more key-value string pairs, comma-separated, which can\n contain information about your test results and other testing information.\n Here's an example:\n\n `gcloud deploy releases promote --annotations=\"from_target=test,status=stable\"`\n\n Annotations on the rollout are immutable, so if you add a status\n annotation, you can't later update that status on the same rollout.\n\n### Using annotations to provide access to test results\n\nIf you have the URL pointing to where test results can be accessed, you can\nprovide that URL as an annotation on a rollout, using the `--annotations` flag.\nHere's an example: \n\n gcloud deploy releases promote --delivery-pipeline=my-demo-app-1 --region=us-central1 --project=my-demo-app-1-project --release=test-release-001 --annotations=\"test_results_url=https://example.com/results/my-demo-app-test-results-dev\"\n\nFor more information, see [Using labels and annotations with Cloud Deploy](/deploy/docs/labels-annotations).\n\nIntegrating with third-party workflow management\n------------------------------------------------\n\nCloud Deploy publishes operational messages to Pub/Sub.\nYour workflow management tool can subscribe to these Pub/Sub topics and use them\nto trigger specific workflows.\n\n### For approvals\n\nThe `clouddeploy-approvals` topic notifies your system when an approval is\nrequired for a rollout. Your external workflow system can then work its magic to\nget the approval, then call `gcloud deploy rollouts approve`.\n\nThe account that issues the `rollouts approve` command must have the predefined\nIAM role `roles/clouddeploy.approver`.\n\nTo set up an external approval workflow:\n\n1. [Require approval on the target](/deploy/docs/promote-release#manage_approvals_for_a_delivery_pipeline).\n\n In the definition for that target, include `requireApproval: true`.\n2. To consume the messages, subscribe to the `clouddeploy-approvals`\n Pub/Sub topic, and set up your workflow management system.\n\n3. When your workflow management system receives a message from the\n `clouddeploy-approvals` topic that includes `\"Action\": \"Required\"`, it kicks off\n an approval workflow, configured according to the requirements of your\n organization.\n\n The message also includes a reference to the rollout to be approved, in the\n following format:\n\n `Resource: projects/.../locations/.../deliveryPipelines/.../releases/.../rollouts/...`\n\n The output of the approval workflow is an [approval or rejection](/deploy/docs/promote-release#manage_approvals_for_a_delivery_pipeline)\n of the rollout.\n4. Your workflow management system returns the approval or rejection to\n Cloud Deploy in the form of the following command:\n\n The command for approval is as follows: \n\n gcloud deploy rollouts approve \u003cvar label=\"rollout\" translate=\"no\"\u003eROLLOUT\u003c/var\u003e \\\n --delivery-pipeline=\u003cvar label=\"pipeline name\" translate=\"no\"\u003ePIPELINE_NAME\u003c/var\u003e \\\n --region=\u003cvar label=\"region\" translate=\"no\"\u003eREGION\u003c/var\u003e \\\n --release=\u003cvar label=\"release name\" translate=\"no\"\u003eRELEASE_NAME\u003c/var\u003e\n\n The command for rejecting the rollout is as follows: \n\n gcloud deploy rollouts reject \u003cvar label=\"rollout\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eROLLOUT\u003c/span\u003e\u003c/var\u003e \\\n --delivery-pipeline=\u003cvar label=\"pipeline name\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ePIPELINE_NAME\u003c/span\u003e\u003c/var\u003e \\\n --region=\u003cvar label=\"region\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eREGION\u003c/span\u003e\u003c/var\u003e \\\n --release=\u003cvar label=\"release name\" translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eRELEASE_NAME\u003c/span\u003e\u003c/var\u003e\n\n where:\n - \u003cvar label=\"rollout\" translate=\"no\"\u003eROLLOUT\u003c/var\u003e\n\n is the name of the rollout for which approval was requested.\n - \u003cvar label=\"pipeline name\" translate=\"no\"\u003ePIPELINE_NAME\u003c/var\u003e\n\n is the delivery pipeline managing deployment of your application.\n - \u003cvar label=\"release name\" translate=\"no\"\u003eRELEASE_NAME\u003c/var\u003e\n\n is the name of the release with which this rollout is associated.\n - \u003cvar label=\"region\" translate=\"no\"\u003eREGION\u003c/var\u003e\n\n is the region in which the delivery pipeline is running.\n\nHere's an example:\n\n`gcloud deploy rollouts approve test-rollout --delivery-pipeline=web-app --release=test-release --region=us-central1`"]]