Auto-Build
Auto-build triggers a CI workflow automatically whenever you push code to your Git repository. Instead of manually creating a WorkflowRun for each build, OpenChoreo creates one for you based on the workflow configuration in your Component.
Platform Engineer Setup Required
Auto-build requires your platform engineer to set up a webhook secret and configure the webhook endpoint. See the PE Auto Build guide for infrastructure setup.
Enable Auto-Build on Your Componentβ
Add autoBuild: true to your Component spec:
apiVersion: openchoreo.dev/v1alpha1
kind: Component
metadata:
name: patient-management-service
spec:
owner:
projectName: default
componentType:
kind: ClusterComponentType
name: deployment/service
autoBuild: true
autoDeploy: true
workflow:
kind: ClusterWorkflow
name: ballerina-buildpack-builder
parameters:
repository:
url: "https://github.com/openchoreo/sample-workloads"
revision:
branch: "main"
appPath: "/service-ballerina-patient-management"
Apply it:
kubectl apply -f component.yaml
Key Fieldsβ
| Field | Description |
|---|---|
autoBuild: true | Enables webhook-triggered builds. Pushes to the configured branch create a WorkflowRun automatically. |
autoDeploy: true | Automatically deploys the generated Workload after a successful build. |
workflow.parameters.repository.revision.branch | The branch that triggers builds on push. |
workflow.parameters.repository.appPath | Only pushes that change files within this path trigger builds. |
What Triggers a Buildβ
When a push event is received, OpenChoreo matches it to Components by checking:
- The repository URL matches the Component's
repository.url - The branch matches the Component's
repository.revision.branch - The push includes changes within the Component's
appPath
If all conditions match, a WorkflowRun is created automatically with the commit SHA from the push event.
Verify Auto-Buildβ
After pushing a change to your repository:
# Check if a WorkflowRun was created
kubectl get workflowrun
# Watch the build progress
kubectl get workflowrun -w
See Alsoβ
- CI Overview β How CI workflows work, monitoring builds, error conditions
- Auto Build Setup β Platform engineer guide for webhook infrastructure setup