<p>Fairly new to GitLab-CI, I'm trying to deploy via Helm on a Kubernetes cluster.
I have this:</p>
<pre><code>image: docker:stable

deploy:
  stage: deploy
  image:
    name: alpine/helm:3.4.1
  script:
    - echo &quot;Deploying to production&quot;
    - helm list --all-namespaces
</code></pre>
<p>And it fails with:</p>
<pre><code>Error: unknown command &quot;sh&quot; for &quot;helm&quot;
</code></pre>
<p>And the <code>echo</code> is not echoed, however, If I were to remove the <code>echo</code> line, the <code>helm</code> cmd would execute successfully.</p>
<p>I guess I'm asking how to make multiline scripts run? How do the gitlab-runner executes the series of commands provided in the <code>script:</code> array?</p>

Moshe
<p>Each entry in the <code>script</code> array runs in an <code>sh</code> shell.</p>
<pre><code>sh -x 'echo &quot;Deploying to production&quot;'
</code></pre>
<p>The <code>alpine/helm</code> image you are using contains an entrypoint of <code>helm</code>
Which means the <code>sh</code> command gitlab is trying to run is being appended to the entrypoint as an argument (e.g. <code>helm sh -x 'echo &quot;Deploying to production&quot;'</code>)</p>
<p><a href="https://gitlab.com/gitlab-org/gitlab-runner/-/issues/2692" rel="noreferrer">Override the entrypoint</a></p>
<pre><code>deploy:
  stage: deploy
  image:
    name: alpine/helm:3.4.1
  entrypoint: [&quot;&quot;]
  script:
    - echo &quot;Deploying to production&quot;
</code></pre>
