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.
- Open the navigation menu and click Developer Services. Under DevOps, click Projects.
- Select a project and a pipeline associated with that project.
- To add the Approval stage sequentially or in parallel, click the + icon and select Add stage.
- Select Control - Approval, and then click Next.
- Enter stage name and optional description.
- Enter the number of approvers.
- 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.
The essential components for load balancing include:
-
A load balancer with pre-provisioned bandwidth.
-
A backend set with a health check policy. See Backend Set Management for more information.
-
Backend servers for your backend set. See Backend Server Management for more information.
-
One or more listeners . See Listener Management for more information.
-
Load balancer subnet security rules to allow the intended traffic. See Security Rules.
To add the Traffic Shift stage using the Console:
Adding a Wait Stage
Wait stage adds a specified duration of delay in the pipeline. During this duration, the deployment is paused.
- Open the navigation menu and click Developer Services. Under DevOps, click Projects.
- Select a project and a pipeline associated with that project.
- To add the Wait stage sequentially or in parallel, click the + icon and select Add stage.
- Select Control - Wait, and then click Next.
- Enter a name and optional description for the stage.
- Enter wait time in seconds.
- 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.