Helm Chart

kind: helmChart

source condition target

source

The Helm chart "source" retrieves the latest version of a Helm package.

condition

The Helm chart "condition" tests if a helm chart release exist.

target

The Helm chart "target" updates a helmchart and bump the chart metadata. It handle AppVersion, incremental version update and requirements.lock. It both works with helm chart located locally or on a git repository. If the helm chart is located locally, then chart name must be an absolute path to the chart.

Parameter

Name Type Description Required
appversion boolean

AppVersion defines if a Chart changes, triggers, or not, a Chart AppVersion update. The value is retrieved from the source input.

	compatible:
		* target

	default
		false
file string

file defines the Helm Chart file to update. the path must be relative to chart root directory the chart name is defined by the parameter “name”

	compatible:
		* source
		* condition
		* target

	default:
		default set to "values.yaml"
key string

key defines the yamlpath query used for retrieving value from a YAML document

	compatible:
		* target

	example:
		* key: $.image.tag
		* key: $.images[0].tag

	remark:
		* key is a simpler version of yamlpath accepts keys.
name string

name defines the Chart name path like ‘stable/chart’.

	compatible:
		* source
		* condition
		* target

	example:
		* name: stable/chart

	remark:
		* when used with a scm, the name must be the relative path from the scm repository root directory
		  with such as "stable/chart"
password string

password specifies the container registry password to use for authentication. Not compatible with token

	compatible:
		* source
		* condition
		* target

	default:
		by default credentials are fetch from the local environment such as `~/.docker/config.json`.

	remark:
		Not compatible with token
skippackaging boolean

skippackaging defines if a Chart should be packaged or not.

	compatible:
		* target

	default: false
token string

token specifies the container registry token to use for authentication.

	compatible:
		* source
		* condition
		* target

	default:
		by default credentials are fetch from the local environment such as `~/.docker/config.json`.

	remark:
		Not compatible with username/password
url string

url defines the Chart location URL.

	compatible:
		* source
		* condition

	example:
		* index.yaml
		* file://./index.yaml
		* https://github.com/updatecli/charts.git
		* oci://ghcr.io/olblak/charts/
username string

username specifies the container registry username to use for authentication.

	compatible:
		* source
		* condition
		* target

	default:
		by default credentials are fetch from the local environment such as `~/.docker/config.json`.

	remark:
		Not compatible with token
value string

value is the value associated with a yamlpath query.

	compatible:
		* condition
		* target
version string

version defines the Chart version. It is used by condition to check if a version exists on the registry.

	compatible:
		* condition
versionfilter object

versionfilter provides parameters to specify version pattern and its type like ‘regex’, ‘semver’, or just ’latest’.

	compatible:
		* source

	default:
		semver

	remark:
		* Helm chart uses semver by default.
    kind string specifies the version kind such as semver, regex, or latest
    pattern string specifies the version pattern according the version kind for semver, it is a semver constraint for regex, it is a regex pattern for time, it is a date format
    regex string specifies the regex pattern, used for regex/semver and regex/time. Output of the first capture group will be used.
    replaceall object replaceAll applies a regex replacement to version strings before filtering. This is useful for transforming versions (e.g., curl-8_15_0 to curl-8.15.0) before regex extraction.
    strict boolean strict enforce strict versioning rule. Only used for semantic versioning at this time
versionincrement string

versionIncrement defines if a Chart changes, triggers, or not, a Chart version update, accepted values is a comma separated list of “none,major,minor,patch,auto”.

	compatible:
		* target

	default:
		default set to "minor"

	remark:
		when multiple pipelines update the same chart, the versionIncrement will be applied multiple times.
		more information on https://github.com/updatecli/updatecli/issues/693

Example

# updatecli.yaml
name: Example of Helm Chart resources

scms:
  default:
    kind: github
    spec:
      user: "john"
      email: "john@example.com"
      owner: "olblak"
      repository: "charts"
      token: "{{ requiredEnv .github.token }}"
      username: "john"
      branch: "master"

sources:
  lastRelease:
    kind: helmchart
    spec:
      url: https://charts.jenkins.io
      name: jenkins

conditions:
  isPrometheuseHelmChartVersionAvailable:
    name: "Test if the prometheus helm chart is available"
    kind: helmchart
    spec:
      url: https://prometheus-community.github.io/helm-charts
      name: prometheus
      version: "11.16.5"

targets:
  chartjenkins:
    name: Bump Jenkins Upstream Chart Version
    kind: helmchart
    spec:
      name: "charts/jenkins"
      file: "requirements.yaml"
      key: "dependencies[0].version"
      versionincrement: minor

What it says:

Source

Retrieve the version from the Jenkins helm chart repository located on "https://charts.jenkins.io" ⇒ 2.7.1

Conditions

Then there is an helmchart condition: "Is the prometheus helm chart version "11.16.5" is available from https://prometheus-community.github.io/helm-charts? ⇒ Yes, proceed, No then abort

Targets If all conditions are met, we bump the Jenkins upstream version into our local one. We remove the requirements.lock if it exists. We bump the chart version using the incremental version (patch,minor,major). Finally we commit our changes and then open a pull request on Github.

Top