ON-PREM CHOREO CLOUD BOTH

What it is

build-pipeline is the automatic build that runs after a change is merged to main in a source repository. It reads the repository's .cicd folder, builds only the components whose files changed, scans each image with Trivy and pushes it to the platform's ECR registry (AWS's container image store). Then it writes the new image tags into the wso2cloud-deployment repository so that dev picks them up.

Think of a factory line: each changed product is boxed, checked at a scanner, shelved in the warehouse, and only then does someone write its new shelf label on the shop's order sheet.

Why it exists

Nobody should build or deploy by hand. One pipeline gives every repository the same build, scan and hand-over steps, and the image only reaches the registry if the scan lets it through.

How it works

  • A push to main reaches the cloud-release event source, and the standard-release sensor (a rule that starts a run when a GitHub event arrives) creates an OpenChoreo WorkflowRun of the build-pipeline ClusterWorkflow. The sensor lists which repositories and branches count: most use main.
  • The run sets the commit status to pending, clones the repository and compares the changed files with each component's trigger.paths in .cicd/*.yaml. The matches become the build matrix.
  • Each matched component is built (Kaniko for docker, Cloud Native Buildpacks for buildpack), scanned by Trivy and only then pushed to its ecrRepository. A vulnerable image is never pushed. Helm charts that opt in with publishTrigger: build are packaged and pushed in the same run.
  • It finds the merged pull request behind the push, clones main of wso2cloud-deployment, writes each new image tag into the files named in workloadPaths and commits to main with the message 'Bump workload images'. The pipeline only updates images that the pushing repository owns in image-owners.yaml.
  • An exit handler sets the final status on the commit and, if the component turned notifications on in its .cicd file, posts a Google Chat card. Notifications are off by default, and when on they report only failures unless the component sets the level to info.

Identity and access

The pipeline reads and writes GitHub as the GitHub App WSO2Cloud CICD, using credentials from a Kubernetes secret. Pods that run build steps get no Kubernetes service-account token, because they run code from the repository being built. A few status steps opt back in.

Key facts

ClusterWorkflow
build-pipeline
Started by
A push to main (sensor standard-release)
Build engines
Kaniko (docker) and Cloud Native Buildpacks (buildpack)
Scan
Trivy, before the push
Image tag example
main- followed by a 40-character commit hash, as seen on the Agent Manager service image
Output
Image in ECR and a 'Bump workload images' commit on main of wso2cloud-deployment
Where it runs
The CI/CD system on the control plane, which currently runs on staging
Namespace
cicd

Talks to (2)

Used by (1)

Inside and around

Contains: Image tag main-<source sha>