<p>I am actually working on a development environment using Gradle, Docker, Minikube and Helm.</p>

<p>I am using a bunch of bash scripts to get things done.</p>

<p>What I achieved so far is:</p>

<ol>
<li>Gradle builds the jar using a plugin for versioning.</li>
<li>Gradle builds a docker image with the same version calculated on the jar job.</li>
</ol>

<p>Now I need to be able to propagate the version calculated by Gradle to Helm so it can pick the right docker image.</p>

<p>The approach I already have in mind is to define an environment variable so it can be used by Helm.</p>

<p>The problem is that I would need to redefine it afterward.</p>

<p>Is any better way of doing that? </p>

<p>Most Helm charts contain at least the following in their <code>values.yaml</code> file, which sets a default docker image tag, and also allows the user installing/upgrading the chart to specify a different image without having to modify the chart itself.</p>

<pre><code># values.yaml
image:
  repository: &lt;docker-repo-url-here&gt;
  tag: &lt;docker-image-tag-here&gt;
</code></pre>

<p>And in the deployment yaml, fetch the values from the values.yaml</p>

<pre><code># deployment.yaml
kind: Deployment
spec:
  template:
    spec:
      containers:
      - name: container-name
        image: "{{ .Values.image.repository }}:{{ .Values.image.tag}}"
</code></pre>

<p>From there, you can do a simple <code>helm upgrade &lt;release-name&gt; &lt;chart-path&gt; --set image.tag=&lt;new-image-tag&gt;</code> when you want to use a new image.</p>
