语法错误:未终止引用的字符串jenkins管道

发布于 2025-02-12 08:26:09 字数 1100 浏览 0 评论 0原文

我正在使用Jenkins Pipeline中使用Helmfile运行Helm图表。我能够设置Jenkins代理来使用此Docker Image Jenkinsciinfra/helmfile,来自 htttps:// github。 com/jenkins-infra/docker-helmfile 。以下是我的管道,

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

我得到了此响应

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

,我尝试运行SH“ Helm版本”,并获得成功响应。我在这里错过什么吗?

我是詹金斯的新手

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

檐上三寸雪 2025-02-19 08:26:09

我能够解决,Docker构建中的Helmfile容器是越野车,我必须用

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}"

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}"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文