shell - 在 jenkins 中运行命令 shell

我正在尝试在 Jenkins 中执行命令 shell ,我正在使用 Windows 7。在控制台输出中我有这个:

Building in workspace C:\Program Files (x86)\Jenkins\workspace\test
[test] $ sh -xe C:\Windows\TEMP\hudson6299483223982766034.sh
The system cannot find the file specified

FATAL: L'exécution de la commande a échoué.
java.io.IOException: Cannot run program "sh" (in directory "C:\Program Files (x86)\Jenkins\workspace\test"): CreateProcess error=2, Le fichier spécifié est introuvable
    at java.lang.ProcessBuilder.start(Unknown Source)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
    at hudson.Launcher$ProcStarter.start(Launcher.java:382)
    at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:97)
    at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
    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:537)
    at hudson.model.Run.execute(Run.java:1744)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:374)
Caused by: java.io.IOException: CreateProcess error=2, Le fichier spécifié est introuvable
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(Unknown Source)
    at java.lang.ProcessImpl.start(Unknown Source)
    ... 16 more
Build step 'Exécuter un script shell' marked build as failure
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
Finished: FAILURE

有什么想法吗?

最佳答案

对于Windows slave,请使用执行Windows批处理命令
对于像 linux 或 Mac 这样的类 Unix 从站,Execute shell 是选项。

https://stackoverflow.com/questions/30374998/

相关文章:

android - targetSdkVersion 和项目构建目标之间的区别

visual-studio - TFS 构建损坏 - 源目录上的目录不为空

rest - Sonatype Nexus REST Api 获取最新的构建版本

.net - 构建后的 MsBuild 复制文件

optimization - Jekyll 编译似乎太慢了

gradle - 为什么我收到 "could not find com.android.tools.

recursion - 如何在 NuSpec 文件中递归地包含目录

c++ - 在构建我的 C++ 可执行文件 (gcc) 时,我可以获得所有链接库的报告吗? (包括静

.net - 有没有办法在 NAnt 中动态加载属性文件?

build - apktool 构建 apk 失败