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.

    1. Open the navigation menu and click Developer Services. Under DevOps, click Projects.
    2. On the DevOps Projects page, select a project, and click Deployment Pipelines on the left-side 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.

      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. Review the parameters and artifacts associated with the stage.
    7. To select the previous deployment stage that you want to roll back to, click Select Deployment.
    8. Select a deployment and click Save Change.
    9. 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.