我正在尝试在 jenkins 上运行一个简单的 python 脚本。
我的环境变量(系统和用户)以及 Manage Jenkins -> Configure System -> environment variable-> python path
中都有 python 路径。
它给了我以下错误。
Running as SYSTEM Building on master in workspace C:\WINDOWS\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\test_py The recommended git tool is: NONE using credential 3ca10573-c869-4767-813b-79b8d149fb2f
> C:\Program Files\Git\bin\git.exe rev-parse --resolve-git-dir C:\WINDOWS\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\test_py\.git
# timeout=10 Fetching changes from the remote Git repository
> C:\Program Files\Git\bin\git.exe config remote.origin.url https://github.com/Av1808/darwin.git # timeout=10 Fetching upstream changes from https://github.com/Av1808/darwin.git
> C:\Program Files\Git\bin\git.exe --version # timeout=10
> git --version # 'git version 2.31.1.windows.1' using GIT_ASKPASS to set credentials
> C:\Program Files\Git\bin\git.exe fetch --tags --force --progress -- https://github.com/Av1808/darwin.git
+refs/heads/*:refs/remotes/origin/* # timeout=10
> C:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10 Checking out Revision 66ca874967e702e7c70d2bb4ce7d8c401c4cbf93 (refs/remotes/origin/master)
> C:\Program Files\Git\bin\git.exe config core.sparsecheckout # timeout=10
> C:\Program Files\Git\bin\git.exe checkout -f 66ca874967e702e7c70d2bb4ce7d8c401c4cbf93 # timeout=10 Commit message: "Adde python script"
> C:\Program Files\Git\bin\git.exe rev-list --no-walk 66ca874967e702e7c70d2bb4ce7d8c401c4cbf93 # timeout=10 [test_py] $ cmd /c call C:\WINDOWS\TEMP\jenkins10615862590324846923.bat
C:\WINDOWS\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\test_py>python test.py 'python' is not recognized as an internal or external command, operable program or batch file.
C:\WINDOWS\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\test_py>exit 9009 Build step 'Execute Windows batch command' marked build as failure Finished: FAILURE