How Updatecli works: The three-stage update policy
mainUpdatecli is a declarative update policy engine. You define an update strategy in a YAML (or Go template) file, which the engine processes through three distinct stages:
- Sources: Fetches the new value to be applied (e.g., the latest Docker image tag, a new Helm chart version, or a GitHub release).
- Conditions (Optional but recommended): Verifies that specific prerequisites are met before any changes are made (e.g., checking if a specific Docker image architecture is available).
- Targets: Applies the fetched change to the intended file or service. If a Source Control Management (SCM) is configured, Updatecli can automatically open a pull request with the changes.
This workflow allows you to automate the detection and application of updates across various file formats, container registries, package managers, and cloud services.
## updatecli.yaml
name: Update Jenkins Version
scms:
default:
kind: github
spec:
# ... SCM configuration
sources:
jenkins:
kind: jenkins
spec:
release: weekly
conditions:
docker:
kind: dockerimage
spec:
image: jenkins/jenkins
targets:
bumpJenkins:
kind: yaml
spec:
file: charts/jenkins/values.yaml
key: $.jenkins.controller.imageTag
actions:
default:
kind: github/pullrequest
target:
- bumpJenkins