4.3 OCI DevOps: Code Repositories, Build Pipelines & Deployment Strategies

Key Takeaways

  • An OCI DevOps project groups code repositories, build pipelines, deployment pipelines, artifacts, environments, and triggers.

  • Build pipelines run managed build stages defined by a build_spec.yaml file and can deliver images to OCIR and generic artifacts to Artifact Registry.

  • OCI DevOps supports blue-green and canary deployment strategies for both OKE and compute instance groups.

  • OKE blue-green and canary deployments require an NGINX ingress controller, while instance group blue-green and canary deployments shift traffic through a load balancer.

  • Canary deployments can roll back automatically to the last successful version if the production stage fails.

Last updated: October 2026

Why CI/CD Is on the Architect Exam

The cloud-native objective explicitly mentions "DevOps practices" with OKE, Container Instances, and the OCI DevOps service. An architect is expected to design a pipeline that builds, tests, scans, and releases services safely, with the ability to roll back quickly. OCI DevOps provides this as a managed service, so you do not maintain Jenkins servers or build agents.

DevOps Building Blocks

ComponentPurpose
ProjectContainer for all DevOps resources of an application; sends notifications to an ONS topic
Code repositoryPrivate Git repositories hosted by OCI DevOps
External connectionLink to GitHub, GitLab, or Bitbucket so their repositories can trigger builds
TriggerStarts a build pipeline on events such as a push to a branch
Build pipelineStages that compile, test, and package code
ArtifactA versioned reference to an output, such as a container image in OCIR, a Kubernetes manifest, a Helm chart, or a generic file in Artifact Registry
EnvironmentA deployment target: an OKE cluster, a compute instance group, or a Functions application
Deployment pipelineStages that release artifacts to environments

Build Pipelines

A managed build stage runs on Oracle-managed build runners. Its instructions live in a build_spec.yaml file in the repository, which defines steps, environment variables, exported variables, and output artifacts. A typical build pipeline has these stages:

  1. Managed build: compile, run unit tests, and build the container image.
  2. Deliver artifacts: push the image to OCIR and upload other outputs, such as manifests, to Artifact Registry.
  3. Trigger deployment: start the deployment pipeline with the new artifact versions.

The build pipeline runs with its own resource principal. You put build pipelines in a dynamic group and grant that group the access it needs, for example manage repos for OCIR and read secret-family to fetch credentials from Vault. Secrets are referenced from Vault in the build specification rather than stored in the repository.

Artifact Registry

Artifact Registry stores generic artifacts, such as JAR files, ZIP packages, or configuration bundles, in repositories. When you create a repository you can choose to make its artifacts immutable, so a published version cannot be overwritten. Container images belong in OCIR, not Artifact Registry.

Deployment Pipelines and Stages

A deployment pipeline is a graph of stages. Common stage types include:

  • Deploy to OKE using Kubernetes manifests, or deploy a Helm chart to OKE.
  • Deploy to an instance group of compute instances (rolling deployment).
  • Deploy to Functions by updating a function to a new image.
  • Invoke function to run custom checks.
  • Wait for a set time.
  • Manual approval, which pauses the release until an approver responds.
  • Shell stage for custom commands.
  • Strategy-specific stages: blue-green deployment and traffic shift, and canary deployment, canary traffic shift, and canary approval.

Deployment Strategies

Rolling Deployment

A rolling deployment updates instances or pods in batches. It needs no extra capacity, but old and new versions run side by side during the rollout, so the API and database schema must stay backward compatible. Rolling back means rolling out the previous version again.

Blue-Green Deployment

Two complete environments exist: blue (current production) and green (new release).

  • For instance groups, DevOps deploys the new version to the green instances and then shifts traffic on the load balancer from the blue backends to the green backends.
  • For OKE, you create two Kubernetes namespaces for the blue and green environments (the namespaces are selected in the stage, not written into the manifests), and an NGINX ingress controller routes traffic. The traffic shift stage switches the ingress so users reach the new namespace.

Rollback is fast: rerun the traffic shift stage manually to send traffic back to the untouched blue environment (blue-green pipelines do not support full pipeline redeployment). The tradeoff is running double capacity during the release window.

Canary Deployment

A small share of traffic goes to the new version first:

  1. Canary deployment stage deploys the new version to a canary environment. For OKE this requires an NGINX ingress controller to route traffic; for instance groups you select a load balancer.
  2. Canary traffic shift stage moves a defined percentage of traffic to the canary, optionally in several rounds.
  3. Canary approval stage lets a person confirm that metrics and logs look healthy.
  4. The production stage releases the new version everywhere.

You can enable automatic rollback to the last successful version if the production stage fails. Canary limits the blast radius of a bad release to a small group of users.

StrategyExtra capacityRollback speedBest for
RollingNoneSlow (redeploy old version)Internal services with compatible versions
Blue-greenDouble during releaseFast (shift traffic back)Critical services needing instant cutover and rollback
CanarySmall canary environmentFast (stop the traffic shift)High-traffic services where risk must be limited

Putting Security Into the Pipeline

A secure pipeline combines several services covered elsewhere in this guide: vulnerability scanning of images in OCIR, image signing with Vault keys and image verification on OKE, Vault secrets for credentials, manual approval stages for production, and Logging of every pipeline run for audit purposes.

Loading diagram...
Build and Canary Release with OCI DevOps
Test Your Knowledge

A team releases a public API on OKE and wants only a small share of users to receive each new version at first, with a person confirming health before the full release and an automatic return to the previous version if the production stage fails. Which OCI DevOps approach fits?

A

A rolling deployment strategy that updates one pod at a time and has no approval stage at all

B

A canary strategy with traffic shift and approval stages, using NGINX ingress and auto rollback

C

A blue-green strategy for instance groups that shifts load balancer traffic all at once

D

A build pipeline that pushes to OCIR and lets Kubernetes pull the latest tag on its own schedule

Test Your Knowledge

A build pipeline must push images to OCIR and read a database password stored in OCI Vault during integration tests, without storing any credentials in the repository. How should access be granted?

A

Put the build pipeline in a dynamic group with manage repos and read secret-family

B

Store a developer's auth token in build_spec.yaml and rotate it manually every month

C

Give every developer manage on repos so the pipeline can reuse their tokens

D

Make the repository public and print the secret in the build log for the tests

Sections you finish are checked off in the contents.