Rolling Back a Deployment
In DevOps, deployments can be rolled back automatically or manually.
Automatic Rollback
When creating a deployment pipeline for a cluster or an instance group, you can select the Automatic Rollback option. If the validation fails, the release is automatically rolled back. If the stage fails, the last successful release version is deployed. During automatic rollback, other in-progress stage continues running, but new stages cannot run, and the deployment completes as Failed.
Manually Roll Back a Deployment
After a deployment is completed, you can manually roll back a stage to a previous successful deployment version or rerun the pipeline deployment.
For accessing DevOps using the Oracle Cloud Console, REST API, and CLI, see Accessing DevOps.
- Open the navigation menu and click Developer Services. Under DevOps, click Projects.
- On the DevOps Projects page, select a project, and click Deployment Pipelines on the left-side menu.
- Select a deployment pipeline and click the Deployments tab.
- Select the deployment that you want to roll back.
- Click the Note
For blue-green instance group deployment, manual rollback is allowed only for the blue-green traffic shift stage. Select Revert traffic shift from the Actions menu for the rollback.
in the top-right corner of the stage that you want to roll back, and select Manual Rollback. - Review the parameters and artifacts associated with the stage.
- To select the previous deployment stage that you want to roll back to, click Select Deployment.
- Select a deployment and click Save Change.
- Click Rollback Stage.
The deployment is successfully rolled back for the selected stage in the pipeline. Rollback of a single stage in the pipeline is considered a new deployment, and a snapshot is provided only for that particular stage during the deployment.
Rollback failure depends on the stage type. For example, rollback of an instance group deployment stage might fail if many hosts in the group fail. The failure also depends on the rollout policy defined when creating the instance group deployment pipeline.
To redeploy a single stage in the pipeline, run the
create-single-stage-redeployment
command:oci devops deployment create-single-stage-redeployment --deployment-id
To deploy a single stage in the pipeline, run the
create-single-stage-deployment
command:oci devops deployment create-single-stage-deployment --deployment-id
To get all the commands for
deployment
:oci devops deployment -h
To redeploy a single stage in the pipeline, use the
CreateDeployment
operation.