[[["易于理解","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-17。"],[[["\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`"]]