Configuration
Updatecli must be fed!
On this page
Updatecli requires a configuration file, aka "manifest", which describes the update pipeline. A manifest can be seen as the "what", the "when", and the "where" of our update pipeline.
What
The "what" is named "source" and defines what piece of information we are looking for such as the latest application release version, a docker image tag, etc.
When
The "when" is named "condition", the condition is that which must succeed to update the target.
Where
The "where" is named "target" and defines where we want to update a piece of information like a value from Dockerfile or a YAML.
Manifest
File
Updatecli expects one file per manifest, aka pipeline. The manifest is split into different stages, "source", "conditions", "targets", where every stage relies on a plugin to adapt the behavior.
A file can be of type yaml or "Go Template" using file extension ".yaml",".yml",".tpl").
Manifest are provided to the updatecli command using the global flag --config <go_template_file>
and --values <yaml_file>
. It accepts either a single file or a directory. If a directory is specified, then it runs recursively on every go templates (or yaml file) inside the directory.
Content
Using go templates allows us to specify generic values in a different YAML file, using --values
, then reference those values from each go template.
Updatecli also provides a custom function called requireEnv
to inject any environment variable in the template example, {{ requiredEnv "PATH" }}
.
Additionally, all functions from the Sprig template library are available.
More information on Go templates can be found here.
An example values file can contains:
github:
token: yourGithubToken
That can used in a pipeline manifest as:
sources:
sourceid:
name: Get release version from
kind: githubRelease
spec:
owner: "updatecli"
repository: "updatecli"
token: "{{ .github.token }}"
username: "olblak"
versionfilter:
kind: "latest"
conditions:
conditionID:
name: Test if version exist
kind: <resourceType>
spec:
<resourceTypeSpec>
targets:
targetID:
name: Update version in target1
kind: <resourceType>
spec:
<resourceTypeSpec>