Jenkins does not recognize command sh?

后端 未结 9 1923
心在旅途
心在旅途 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:08

    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:

    1. Install Environment Injector Plugin
    2. Open your pipeline and enable Prepare an environment for the run check box and add PATH=/sbin:/usr/sbin:/usr/bin:/usr/local/bin:/bin inside Properties Content text box.

提交回复
热议问题