How chart version and image tags are determined#

Chartpress will infer chart versions and image tags using a few key pieces of information.

  1. tag: If not directly set by --tag, it will be inferred from most recent commit that is tagged in the current branch (as determined by git describe) or be set to 0.0.1 if no commit is tagged.

    1. If the tag has a leading v but is otherwise a valid SemVer2 version, the v will be stripped from Chart.yaml before its set as Helm 3 requires Helm chart versions to be SemVer2 compliant.

  2. The latest commit modifying content in a relevant path since tag.

    1. n: The number of commits since the latest tagged commit on the branch, as an integer.

    2. hash: The latest commit’s abbreviated hash, which is often 7-8 characters, prefixed with h.

  3. If tag (like 0.10.0 or 0.10.0-beta.1) contains a -, a tag.git.n.hash format will be used, and otherwise a tag-0.dev.git.n.hash format will be used.

  4. If --long is specified or not. If --long is specified, tagged commits will always be written out with the .git.n.hash part appended to it, looking something like 1.0.0-0.dev.git.0.habcd123

When producing a development version (with .git.n.hash on the end), The base version can come from one of two places, depending on your configuration. See controlling-development-version for more info.

Examples chart versions and image tags#

This is a list of realistic chart versions and/or image tags in a chronological order that could come from using chartpress.

0.8.0
0.8.0-0.dev.git.4.hasdf123
0.8.0-0.dev.git.10.hsdfg234
0.9.0-beta.1
0.9.0-beta.1.git.12.hdfgh345
0.9.0-beta.1.git.15.hfghj456
0.9.0-beta.2
0.9.0-beta.2.git.20.hghjk567
0.9.0-beta.3
0.9.0