詹金斯不识别命令sh? [英] Jenkins does not recognize command sh?

查看:200
本文介绍了詹金斯不识别命令sh?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试让Jenkinsfile工作时遇到了很多麻烦. 我一直在尝试运行此测试脚本:

I've been having a lot of trouble trying to get a Jenkinsfile to work. I've been trying to run this test script:

#!/usr/bin/env groovy
node {
    stage('Build') {
        echo 'Building....'
        // Create virtualenv
        sh 'echo "hi"'
    }
    stage('Test') {
        echo 'Building....'
    }
    stage('Deploy') {
        echo 'Deploying....'
    }
}

但是在尝试构建时,我总是收到此错误:

But I keep getting this error when trying to build:

Warning: JENKINS-41339 probably bogus PATH=/usr/lib64/ccache:/usr/lib64/ccache:$PATH; perhaps you meant to use ‘PATH+EXTRA=/something/bin’?
[test-job-jenkinsfile-pipeline] Running shell script
nohup: failed to run command `sh': No such file or directory

我将所有管道插件更新为最新版本,但仍然遇到此错误.有帮助吗?

I updated all the pipeline plugins to the latest version and still run into this error. Any help?

推荐答案

所以看来,原因是全局属性PATH引起了该问题.通过转到Manage Jenkins-> Configure System并删除PATH全局属性,解决了我的问题.参见 JENKINS-41339 .

So it seems the reason was that the global property PATH was causing the issue. By going to Manage Jenkins -> Configure System and deleting the PATH global property solved my issue. See JENKINS-41339.

这篇关于詹金斯不识别命令sh?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆