gpt4 book ai didi

jenkins - jenkins 中的 Windows 批处理命令失败

转载 作者:行者123 更新时间:2023-12-03 07:00:38 26 4
gpt4 key购买 nike

我已经在 Docker 中设置了 Jenkins,并且能够运行一些 ANT 脚本,我现在必须运行一些“Windows 批处理脚本”。我给出了一个基本命令 echo“Hello”,但我收到以下错误...我相信它期望 cmd.exe 出现在我的工作空间中???有人可以帮我解决这个问题吗?提前致谢。

[CI] $ cmd /c call /tmp/hudson5615964182226568321.bat
FATAL: command execution failed
java.io.IOException: Cannot run program "cmd" (in directory "/var/jenkins_home/workspace/CI"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at hudson.Proc$LocalProc.<init>(Proc.java:243)
at hudson.Proc$LocalProc.<init>(Proc.java:212)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:815)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:95)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:64)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.Build$BuildExecution.build(Build.java:205)
at hudson.model.Build$BuildExecution.doRun(Build.java:162)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1720)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)

... 15 更多构建步骤“执行 Windows 批处理命令”将构建标记为失败完成:失败

最佳答案

您的 Jenkins 设置必须在 Linux 中,当您选择“Windows 批处理 COMmand”时,该命令将无法在 Linux 系统中运行。因此,系统向您描述cmd无法在Unix机器上执行。

Cannot run program "cmd" (in directory "/var/jenkins_home/workspace/CI"): error=2, No such file or directory

关于jenkins - jenkins 中的 Windows 批处理命令失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42016767/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com