Skip to content

Git tag -> image tag

Suppose my-chart has default values.yaml:

image:
  repository: registry.gitlab.local/example/app
  tag: v1.0.0
...

If we need to create CI/CD pipeline, we need use next script

helm upgrade --instal my-release my-chart-repo/my-chart-app --set="image.tag=$CI_COMMIT_TAG" -n my-namespace

HelmWave allows use declarative way to approach this goal.

Project structure

docs/examples/pass-git-tag
├── README.md
├── helmwave.yml
└── values.yml

0 directories, 3 files
helmwave.yml
project: "Example: pass git tag"
version: "0.35.1"

releases:
  - name: my-release
    chart: my-chart-repo/my-chart-app
    values:
      - values.yml
    namespace: my-namespace
    create_namespace: true

This values will override default values

values.yml
image:
  tag: {{ env "CI_COMMIT_TAG" }}

Run

helmwave build
helmwave up

or helmwave up --build