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

For accessing DevOps using the Oracle Cloud Console, REST API, and CLI, see Accessing DevOps.

Using the Console

  1. Open the navigation menu and click Developer Services. Under DevOps, click Projects.
  2. Select a project, and click Deployment Pipelines in the left menu.
  3. Select a deployment pipeline and click the Deployments tab.
  4. Select the deployment that you want to roll back.
  5. Click the Actions menu Actions menu in the top-right corner of the stage that you want to roll back, and select Manual Rollback.
    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.
  6. You can review the parameters and artifacts associated with the stage.
  7. Click Select Deployment to select the previous deployment stage that you want to roll back to.
  8. 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 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

Using the API

To redeploy a single stage in the pipeline, use the CreateDeployment operation.

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.