0

我正在尝试让 Jenkins 工作为我安装 python,然后使用Python Plugin执行脚本。

到目前为止,我得到了 python 并安装得很好,我还为 python 设置了环境变量,但是插件不会启动

系统找不到指定的文件 FATAL: command execution failed java.io.IOException: Cannot run program "python" (in directory "C:\Jenkins\workspace\install and configure python"): CreateProcess error=2, 系统不能找到指定的文件

据我了解,这是因为 python.exe 不在 PATH 中。所以我尝试过:
1)在批处理中将其添加到 PATH -FAILED
2)使用 Environment Injector Plugin -FAILED 添加到作业中的 PATH 变量以“为运行准备环境”

所以我的猜测是我必须重置节点的java.library.path或重新启动 Jenkins 从代理。

问题:有什么想法可以做到吗?

以下是我目前所拥有的用于 python 安装的“Windows 批处理命令”:

::verify installation is needed
python --version
if %errorlevel% EQU 0 EXIT 0

:: get the wget utility
cscript.exe .\web\vbs\download-wget.vbs

::get python 27 from server
wget.exe --no-check-certificate https://qaa.myserver.com/public/python27/python-2.7.3.msi

::install python
msiexec /i python-2.7.3.msi /qn TARGETDIR=c:\Python27

::because of the stupid bug https://issues.jenkins-ci.org/browse/JENKINS-3425
set temppath=%PATH:"=%
setx PATH "%temppath%" /m

在此之后,我通过 Python 插件进行了第二次构建步骤print "Hello, World"

4

0 回答 0