Automate your deployment Stay organized with collections Save and categorize content based on your preferences.
This document is an overview of deploy automation.
You can configure Cloud Deploy to automatically perform release-relatedand rollout-related tasks for a given delivery pipeline. These tasks includerelease promotionandphase advancement.
Learn more about the resources used forrelease automation in Cloud Deploy.
Learn more about how to set up the rules thatdefine how these automations work.
Actions you can automate
In Cloud Deploy, you can automate the following release androllout activities:
Promote a release automatically
You can configure Cloud Deploy to promote your releaseautomatically, upon a successful rollout to a target. For example, if youhave three targets,
dev,staging, andprod, you can configure anautomation such that the release is promoted toprod, without further humaninteraction, upon a successful deployment intostaging. You can also specifya delay time.Promote a release on a schedule
You can configure Cloud Deploy to promote your release accordingto a cron schedule.
You can configure Cloud Deploy to advance a rollout from onephase to the next,after a successful rollout to the previous target. Phase advancement isavailable only in targets that use acanary deployment strategy.
You can configure Cloud Deploy to automatically retry a failedrollout. This includes retrying the rollout a specified number of times, andautomatically rolling back if that number of retries fail.
SeeAutomation rules for more information onthese actions, and how to configure them.
How does automation work?
Each automation is tied to the delivery pipeline for which it's used. You can'tshare an automation across multiple delivery pipelines.
The following is the general process for configuration and execution of anautomation:
This automation is associated with one delivery pipeline.
You register that automation using
gcloud deploy apply.This creates theAutomation resource.
You invoke the delivery pipeline associated with this automation bycreating a release.
The rollout succeeds for at least one target, or fails.
If the rollout succeeds, and the automation is
promoteReleaseRule:Execution waits for the rollout to succeed into the source target.The source target is the
selector.targetsconfigured for the automation,not in theAutomationRule.If there is a
waittime configured, execution waits for that time also.The release is automatically promoted to the next target in the pipelineprogression, or to a specific target,if indicated.
If the rollout succeeds, and the automation is
advanceRolloutRuleand thetarget uses a canary deployment strategy:Execution waits for the identifiedsource phase,if there is one.
The
sourcePhaseproperty is optional, and if no source phases arespecified, each phase in the rollout is advanced automatically. Theautomatic phase advancement happens when the source phase isIN_PROGRESS, subject towaittime.If there is a
waittime configured, execution waits for that time also.When you're automating a canary deployment, you use this wait time tospecify the duration of each canary phase.
The rollout is automatically advanced from that source phase to the nextphase in the rollout.
If there's an additional source phase, it's treated the same, including thesame wait time, if applicable.
If the rollout fails, and there's an automation with a
repairRolloutrule:The rollout is retried, after the configured
waittime, if any.If specific phases or jobs are configured in this
repairRolloutrule,only those phases or jobs are retried. The default, if no jobs or nophases are specified, is to retry all phases and jobs in the rollout.Because retries are optional, if your automation isn't configured toretry, then this step doesn't happen.
If the first retry fails, execution waits for the configured
waittime,then tries again.Retries are repeated until Cloud Deploy has exhausted theretry
attempts.If each attempt fails, and the
attemptsare exhausted, the rolloutfails.During retries, the rolloutstateis
IN_PROGRESSuntil either the rollout succeeds or fails following thefinal retry attempt. The phasestate isIN_PROGRESSduring retries, butFAILEDafter each rolloutfailure.If all retries fail (or none are configured), a new rollout is created torollback to the most recent successful release on the target.
Automation resources
There are two Cloud Deploy resources that are specifically forautomation:
Automation
An
Automationis a child resource of a delivery pipeline, and it includesthe following information:- A pointer to the target or targets for which the automation is used
- The rule or rules that govern what the automation does and how it does it
Configuration for the Automation resource is described in the documentAbout the automation resource.
When you run
gcloud deploy applyagainst a file that includes an automationconfiguration (kind: Automation), Cloud Deploy creates anautomation resource,which associates a delivery pipeline and a target or targets with one or moreautomation rules.Automation run
The
AutomationRunis an instance of an automation. It's a pointer to itscorresponding Automation resource, plus information about the rollout thatspawned it, and other metadata.The automation run is created when an automation is triggered.
Learn more about automation resources.
Automation rules
An automation rule defines an action that can be taken on your delivery pipelineautomatically, as well as details about how the automation is to be performed.
Learn more about automation rules.
Identity and Access Management roles and permissions required
In addition to the permissions you need to run any Cloud Deploydelivery pipeline, and to perform the tasks to be automated (like advancinga rollout), there are several permissions that are needed in order to performcertain operations on theAutomation andAutomationRun resources:
clouddeploy.automations.createclouddeploy.automations.deleteclouddeploy.automations.getclouddeploy.automations.listclouddeploy.automations.updateclouddeploy.automationRuns.cancelclouddeploy.automationRuns.getclouddeploy.automationRuns.list
In addition to these permissions, each automation rule might require furtherpermissions to perform the automated operation. SeeConfigure automation rulesfor the specific permissions needed per automation rule.
SeeIAM roles and permissionsFor more information, including which Cloud Deployroles include these permissions.
Create an automation
You can create an automation, including using any of theavailable automation rules,by configuring an automation, then creating the automation resource usinggcloud deploy apply
See the following section (Configuring automation), andConfiguring automation rules.
Configuring automation
See theConfiguration file schemafor details on how to configure theAutomation resource.
Automation rule configuration
In addition to this automation configuration, you specifyautomation rules. Configuration is differentfor each of the available rules.
SeeUsing automation rules for descriptions of eachof the available rules.
Suspend an automation
You can suspend an existing resource without deleting it. This can be usefulfor testing an automation without affecting the delivery pipeline. When yoususpend an automation, the automation isn't run, butplatform logs are still generated.
In the
Automationconfiguration,Update thesuspendedproperty totrue.Run
gcloud deploy applyagainst that configuration file.Platform logs are still generated when theautomation is instantiated, even if it's suspended. You can use this to test anddebug the automation without affecting the delivery pipeline.
What's next
Try thequickstart: Automate release creation and rollout advancement.
Learn more about Cloud Deployautomation rules.
Learn more about Cloud Deployautomation resources.
See theconfiguration file schema documentationfor details on the automation configuration files.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-18 UTC.