Jenkins does not recognize command sh?

后端 未结 9 1955
心在旅途
心在旅途 2020-12-09 09:27

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(\'         


        
9条回答
  •  北荒
    北荒 (楼主)
    2020-12-09 10:00

    Another way to avoid this issue and also not deleting global PATH at Manage Jenkins -> Configure System is to specify the PATH differently, apparently the following works fine and can append the PATH in the current environment

    pipeline {
    agent any
    environment {
      PATH = "/usr/local/bin:$PATH"
    }
    

    but the following results into nohup: failed to run command sh': No such file or directory

    pipeline {
    agent any
    environment {
      PATH = "/usr/local/bin:${env.PATH}"
    }
    

提交回复
热议问题