Configuration

Updatecli must be fed!

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" }}.

More information on Go templates can be found here

github:
  token: yourGithubToken
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>

Go Further

  • To know more about Condition syntax condition

  • To know more about Source syntax source

  • To know more about Target syntax target

  • To know more about Plugins

    • More specifically about the source

    • More specifically about the condition

    • More specifically about the target

    • More specifically about the SCM

Top