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?
Jenkins' most friendly and simplest solution while dealing with environment variables is to use Environment Injector Plugin
so to fix this issue you just need to do the following:
PATH=/sbin:/usr/sbin:/usr/bin:/usr/local/bin:/bin
inside Properties Content text box.