Rolling Back a Deployment
In DevOps, deployments can be rolled back manually or automatically.
After a deployment is completed, you can manually roll back a stage to a previous successful deployment version or rerun the pipeline deployment.
Manually Roll Back a Deployment
Using the Console
- Open the navigation menu and click Developer Services. Under DevOps, click Projects.
- Select a project, and click Deployment Pipelines in the left menu.
- Select a deployment pipeline and click the Deployments tab.
- Select the deployment that you want to roll back.
- Click the Actions menu in
the top-right corner of the stage that you want to roll back, and select Manual
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.
- You can review the parameters and artifacts associated with the stage.
- Click Select Deployment to select the previous deployment stage that you want to roll back to.
- 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.
Using the CLI
To redeploy a single stage in the pipeline, run the
oci devops deployment create-single-stage-redeployment --deployment-id
To deploy a single stage in the pipeline, run the
oci devops deployment create-single-stage-deployment --deployment-id
To get all the commands for
oci devops deployment -h
Using the API
To redeploy a single stage in the pipeline, use the
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.