Helm Chart

kind: helmChart

sourceconditiontarget

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

NameTypeDescriptionRequired
appversionboolean[target] Enable AppVersion update based in source input.
filestring[target] Defines the Helm Chart file to update.
keystring[target] Defines the key to update within the file.
namestring[target] Defines the Chart name path like 'stable/chart'.
passwordstring[S][C][T] Password specifies the container registry password to use for authentication. Not compatible with token
tokenstring[S][C][T] Token specifies the container registry token to use for authentication. Not compatible with username/password
urlstring[source,condition] Defines the chart location URL.
usernamestring[S][C][T] Username specifies the container registry username to use for authentication. Not compatible with token
valuestring[target] Defines the value to set for a key
versionstring[source,condition] Defines the Chart version, default value set based on a source input value
versionfilterobjectVersionFilter provides parameters to specify version pattern and its type like 'regex', 'semver', or just 'latest'.
    kindstringSpecifies the version kind such as semver, regex, or latest
    patternstringSpecifies the version pattern according the version kind
    strictbooleanStrict enforce strict versioning rule. Only used for semantic versioning at this time
versionincrementstring[target] Defines if a Chart changes, triggers, or not, a Chart version update, accepted values is a comma separated list of "none,major,minor,patch"

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