1
node{
    def app
    stage ("Build Image"){
        bat 'cd C:/Users/trivedi2/Desktop/DEV_pipeline/DEV_Workspace'
         app = docker.build("CDashboard")
     }
    }

This is my pipeline code for creating docker images error while running jenkins job:nohup: failed to run command 'sh': No such file or directory Can any one help me with this issue. I am using windows machine

pitseeker
  • 2,535
  • 1
  • 27
  • 33

1 Answers1

0

First set the env PATH variable in the machine which points out to a sh.exe in Git->bin

Second Try to do a sysmlink to nohup.exe as the error susggest

mklink "C:\Program Files\Git\bin\nohup.exe" "C:\Program Files\git\usr\bin\nohup.exe"

After this setup you can use node{sh "git --version" in your jenkinsfile and it works fine. https://stackoverflow.com/a/45151156/3648023