Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
É possível integrar o Cloud Deploy a alguns dos outros sistemas em que você confia para a entrega de software. Esta página descreve como integrar o Cloud Deploy
com o seguinte:
É possível usar o Cloud Deploy com o Pub/Sub para integrar testes
ao seu pipeline de entrega. Assim, você pode promover a versão automaticamente, para
entrega contínua.
é o nome do pipeline de entrega que gerencia esta versão. Este valor é
obrigatório.
REGION
é a região em que o pipeline está sendo executado. Se você definiu a propriedade
deploy/region, pode omitir essa flag.
KEY=VALUE,...
é uma lista de um ou mais pares de strings de chave-valor, separados por vírgula, que podem
conter informações sobre os resultados e outras informações sobre o teste.
Veja um exemplo:
As anotações na implementação são imutáveis. Portanto, se você adicionar uma anotação
de status, não será possível atualizar esse status posteriormente no mesmo lançamento.
Como usar anotações para fornecer acesso a resultados de testes
Se você tiver o URL que aponta para onde os resultados do teste podem ser acessados, forneça
esse URL como uma anotação em um lançamento, usando a sinalização --annotations.
Veja um exemplo:
Integração com o gerenciamento de fluxos de trabalho de terceiros
O Cloud Deploy publica mensagens operacionais no Pub/Sub.
Sua ferramenta de gerenciamento de fluxo de trabalho pode se inscrever nesses tópicos do Pub/Sub e usá-los para acionar fluxos de trabalho específicos.
Para aprovações
O tópico clouddeploy-approvals notifica seu sistema quando uma aprovação é necessária para um lançamento. Seu sistema de fluxo de trabalho externo pode trabalhar na mágica para
receber a aprovação e, em seguida, chamar gcloud deploy rollouts approve.
A conta que emite o comando rollouts approve precisa ter o papel predefinido
roles/clouddeploy.approver do IAM.
Para configurar um fluxo de trabalho de aprovação externo:
Na definição desse destino, inclua requireApproval: true.
Para consumir as mensagens, inscreva-se no tópico clouddeploy-approvals
do Pub/Sub e configure o sistema de gerenciamento do fluxo de trabalho.
Quando seu sistema de gerenciamento de fluxo de trabalho recebe uma mensagem do
tópico clouddeploy-approvals que inclui "Action": "Required", ele inicia
um fluxo de trabalho de aprovação, configurado de acordo com os requisitos da sua
organização.
A mensagem também inclui uma referência ao lançamento a ser aprovado, no seguinte formato:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-03 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`"]]