<p>I am pushing Docker images to our private registry via Jenkins with the following command:  </p>

<pre><code>def dockerImage = docker.build("repo/myapp:${env.BUILD_NUMBER}")
</code></pre>

<p>(<code>BUILD_NUMBER</code> increases after every build.)</p>

<p>Because I am new to using Helm, I could not decide how should I give the tag for images in <code>values.yaml</code>.</p>

<p>I would like to deploy my app to multiple environments such as:</p>

<ul>
<li><code>dev</code></li>
<li><code>test</code></li>
<li><code>prod</code></li>
</ul>

<p>Let's say I was able to deploy my app via Helm to <code>dev</code>, and the latest <code>BUILD_NUMBER</code> is:</p>

<ul>
<li>100 for <code>dev</code></li>
<li>101 for <code>test</code></li>
<li>102 for <code>prod</code></li>
</ul>

<p>What should be the tag value, then?</p>

<pre><code> image:
  repository: registryt/myrepo/image
  tag: 
</code></pre>

<p>You should put "some" tag into your <code>values.yaml</code> which will act as the default <code>tag</code>. Each Helm Chart has it, you can check the official Helm Charts <a href="https://github.com/helm/charts/tree/master/stable" rel="noreferrer">here</a>.</p>

<p>Now, you have two options on how to act with the different environments.</p>

<h1>Option 1: Command line parameters</h1>

<p>While installing your Helm Chart, you can specify the tag name dynamically with <code>--set</code>. For example:</p>

<pre><code>$ helm install --set image.tag=12345 &lt;your-chart-name&gt;
</code></pre>

<h1>Option 2: Separate values.yaml files</h1>

<p>You can store separate <code>values.yaml</code> in your repository, like:</p>

<pre><code>values.dev.yaml
values.prod.yaml
</code></pre>

<p>Then, update the correct values in your Jenkins pipeline.</p>
