Adding a Control Stage

Learn how to add a control stage to any deployment pipeline.

You can add the following types of control stages to a pipeline:

Before you add a control stage, you must have a deployment pipeline defined.

Required IAM Policy

Each service in Oracle Cloud Infrastructure (OCI) integrates with Identity and Access Management (IAM) for authentication and authorization. To grant users permission to access the DevOps deployment pipelines and other resources, you have to create dynamic groups and IAM policies.

For creating dynamic groups and policies for deployment pipelines, see Deployment Pipeline Policies. For more details, see DevOps IAM Policies.

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

Adding an Approval Stage

Approval stage pauses the deployment for a specified duration for manual decision from the approver. Approvers are notified of deployments that are pending manual approval. The default timeout period for approval is one day after which the deployment fails. You can configure the manual approval stage to require more than one approval. Approvers can approve or reject deployments.

  1. Open the navigation menu and click Developer Services. Under DevOps, click Projects.
  2. Select a project and a pipeline associated with that project.
  3. To add the Approval stage sequentially or in parallel, click the + icon and select Add stage.
  4. Select Control - Approval, and then click Next.
  5. Enter stage name and optional description.
  6. Enter the number of approvers.
  7. To add the Approval stage to the pipeline, click Add.

Adding a Traffic Shift Stage

Traffic Shift stage routes the traffic between two sets of backend IPs. You can specify the IPs in each group and also configure the batch count and batch delay based on which the traffic is distributed.

Before adding this stage, you must have a load balancer and listener configured in the Oracle Cloud Console. When you create a load balancer resource, you must specify the backend servers. See Load Balancer Management.

The essential components for load balancing include:

To add the Traffic Shift stage using the Console:

  1. Open the navigation menu and click Developer Services. Under DevOps, click Projects.
  2. Select a project and a pipeline associated with that project.
  3. To add the Traffic Shift stage sequentially or in parallel, click the + icon and select Add stage.
  4. Select Control - Traffic Shift, and then click Next.
  5. Enter stage name and optional description.
  6. Click Select load balancer.
    1. Select the load balancer region and compartment.
    2. Select a load balancer from the available list.
  7. Select a listener from the available list.
    After you select a listener, the IP addresses of the servers in the backend set are listed under two groups: group A and group B. You can select an IP address to be in one of the two groups.
  8. To shift the traffic to one of the target groups, select the Traffic Target.
    The Traffic Shift stage shifts the traffic to the selected IP addresses in the target group.
  9. Enter a Batch Count to define the total number of batches that are used to shift the traffic.
    For example, if the batch count is 5, then the traffic shift occurs in 5 batches.
  10. Enter a Batch Delay in seconds to define the delay between each batch.
  11. (Optional) Enter Ramp Limit to specify the maximum traffic to be shifted.
    For example, if the ramp limit is 50 and batch count is 5, then each batch shifts an additional 10% (50/5) of the traffic to the selected target group. The default ramp limit is 100 implying 100% traffic shift to the target group. The service adjusts the weight of the backend set to achieve the preferred traffic shift configuration.
  12. To add the Traffic Shift stage to the pipeline, click Add.

Adding a Wait Stage

Wait stage adds a specified duration of delay in the pipeline. During this duration, the deployment is paused.

  1. Open the navigation menu and click Developer Services. Under DevOps, click Projects.
  2. Select a project and a pipeline associated with that project.
  3. To add the Wait stage sequentially or in parallel, click the + icon and select Add stage.
  4. Select Control - Wait, and then click Next.
  5. Enter a name and optional description for the stage.
  6. Enter wait time in seconds.
  7. To add the Wait stage to the pipeline, click Add.

Using the CLI

To add an approval stage to the pipeline, run the create-manual-approval-stage command:

oci devops deploy-stage create-manual-approval-stage

Required parameters for the create-manual-approval-stage command:

  • --approval-policy
  • --pipeline-id
  • --stage-predecessor-collection

To add a traffic shift stage to the pipeline, run the create-load-balancer-traffic-shift-stage command:

oci devops deploy-stage create-load-balancer-traffic-shift-stage

Required parameters for the create-load-balancer-traffic-shift-stage command:

  • --blue-backend-ips
  • --green-backend-ips
  • --load-balancer-config
  • --pipeline-id
  • --rollout-policy
  • --stage-predecessor-collection
  • --traffic-shift-target

To add a wait stage to the pipeline, run the create-wait-stage command:

oci devops deploy-stage create-wait-stage

Required parameters for the create-wait-stage command:

  • --wait-criteria
  • --pipeline-id
  • --stage-predecessor-collection

To get all the commands for deploy-pipeline and deploy-stage:

oci devops deploy-pipeline -h
oci devops deploy-stage -h

To get help for the create-manual-approval-stage command:

oci devops deploy-stage create-manual-approval-stage -h

To get help for the create-load-balancer-traffic-shift-stage command:

oci devops deploy-stage create-load-balancer-traffic-shift-stage -h

To get help for the create-wait-stage command:

oci devops deploy-stage create-wait-stage -h

Using the API

To add an approval stage to the pipeline, use the CreateDeployStage operation. For deployStageType attribute, specify the MANUAL_APPROVAL value.

To add a traffic shift stage to the pipeline, use the CreateDeployStage operation. For deployStageType attribute, specify the LOAD_BALANCER_TRAFFIC_SHIFT value.

To add a wait stage to the pipeline, use the CreateDeployStage operation. For deployStageType attribute, specify the WAIT value.