0

I'm working on running helm charts using helmfile in Jenkins pipeline. I was able to setup Jenkins Agent to use this docker image jenkinsciinfra/helmfile from https://github.com/jenkins-infra/docker-helmfile. below is my pipeline

pipeline{
        agent {
            label 'helm'
            
        }
        stages{
                
                stage("helm version") {
                        steps {
                            sh "helmfile version"
                    }
            }
        }
}

I get this response

Running on helm-thxmv in /home/jenkins/agent/workspace/helmfile
[Pipeline] {
[Pipeline] stage
[Pipeline] { (helm version)
[Pipeline] sh

+ helmfile --version
/usr/local/bin/helmfile: line 1: syntax error: unterminated quoted string
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 2
Finished: FAILURE

I have tried running sh "helm version" and i get success response. Am I missing anything here?

I'm very new to Jenkins

James Z
  • 12,209
  • 10
  • 24
  • 44

1 Answers1

0

I was able to resolve, The helmfile container in the docker build was buggy, I had to replace the helmfile section with

ARG HELMFILE_VERSION=0.144.0
RUN wget "https://github.com/roboll/helmfile/releases/download/v${HELMFILE_VERSION}/helmfile_linux_amd64" --quiet --output-document=/usr/local/bin/helmfile \
  && chmod +x /usr/local/bin/helmfile \
  && helmfile --version | grep -q "${HELMFILE_VERSION}"