0

This is the basic pipeline.

pipeline {
  agent any
  stages {
    stage('version') {
      steps {
        bat 'python --version'
      }
    }  
}
}

I just tried to build this on jenkins, but keep getting an error.

Obtained Jenkinsfile from git https://github.com/Incognitoe/python_try.git
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in C:\ProgramData\Jenkins\.jenkins\workspace\youtube_python_sample
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
Selected Git installation does not exist. Using Default
The recommended git tool is: NONE
No credentials specified
 > C:\Program Files\Git\bin\git.exe rev-parse --resolve-git-dir C:\ProgramData\Jenkins\.jenkins\workspace\youtube_python_sample\.git # timeout=10
Fetching changes from the remote Git repository
 > C:\Program Files\Git\bin\git.exe config remote.origin.url https://github.com/Incognitoe/python_try.git # timeout=10
Fetching upstream changes from https://github.com/Incognitoe/python_try.git
 > C:\Program Files\Git\bin\git.exe --version # timeout=10
 > git --version # 'git version 2.41.0.windows.3'
 > C:\Program Files\Git\bin\git.exe fetch --tags --force --progress -- https://github.com/Incognitoe/python_try.git +refs/heads/*:refs/remotes/origin/* # timeout=10
 > C:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/main^{commit}" # timeout=10
Checking out Revision 9e8a8f378ea4966aadf324fd0edda43986f66f1a (refs/remotes/origin/main)
 > C:\Program Files\Git\bin\git.exe config core.sparsecheckout # timeout=10
 > C:\Program Files\Git\bin\git.exe checkout -f 9e8a8f378ea4966aadf324fd0edda43986f66f1a # timeout=10
Commit message: "Add files via upload"
First time build. Skipping changelog.
[Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (version)
[Pipeline] bat
'cmd' is not recognized as an internal or external command,
operable program or batch file.
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 9009
Finished: FAILURE

"'cmd' is not recognized as an internal or external command, operable program or batch file." what is the reason for this?

Rjj123
  • 1
  • 3

0 Answers0