This page describes how to roll back a Cloud Deploy target to an earlier release.
When you roll back a target, Cloud Deploy creates a new rollout
resource based on a previous release.
Roll back a target to an earlier release
gcloud CLI
By default, the rollback uses the last release with a successful rollout to
the indicated target, but you can choose a different one, using --release
.
To roll back, run the following command from the directory containing your delivery pipeline:
gcloud deploy targets rollback TARGET_NAME \
--delivery-pipeline=PIPELINE_NAME \
--release=RELEASE_NAME \
--rollout-id=ROLLOUT_ID
In this command, --release
and --rollout-id
are optional.
Use --release
to identify a specific release to roll back to. If you omit
this option, then Cloud Deploy uses the last known good release
to the specified target.
Use --rollout-id
to assign an identifier to the generated rollout
. If
you omit this, Cloud Deploy generates an ID for the generated
rollout
.
Console
Click your pipeline shown in the list of delivery pipelines.
The Delivery pipeline details page shows a graphical representation of the progress of your delivery pipeline.
Click the more menu and select Roll back release.
The rollback form is displayed:
Select the release from the Release field.
This release is the one which you're rolling back to. The Rollout name is populated based on the selected release.
If you want, you can change the rollout name and rollout description from the default.
Click Roll back.
A new rollout is created from the chosen release, and deployed into the same target.
Roll back even further
You can roll back manually to an earlier release than the last successfully deployed one.
Simply run gcloud deploy releases promote
with the earlier release and
include the--to-target
option set to the target in which you want to roll back
your release.