Skip to content

Restart pods via git-commit

Project Structure

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

0 directories, 3 files
helmwave.yml
project: "Example: pass git commit"
version: "0.39.1"

repositories:
  - name: bitnami
    url: https://charts.bitnami.com/bitnami

releases:
  - name: my-app
    chart: bitnami/nginx
    values:
      - values.yml
    namespace: my-namespace
    create_namespace: true

nginx/template/deployment.yaml looks like that:

    ...
    metadata:  
      {{- with .Values.podAnnotations }}  
      annotations:  
        {{- toYaml . | nindent 8 }}  
      {{- end }}
    ...

We will pass pod annotations with values

Suppose that CI_COMMIT_SHORT_SHA contains commit short sha hash.

values.yml
podAnnotations:
  gitCommit: {{ requiredEnv "CI_COMMIT_SHORT_SHA" | quote }}

Run

helmwave build
helmwave up

or helmwave up --build