简体   繁体   English

詹金斯没有完成“执行Windows命令”步骤

[英]jenkins does not complete 'execute windows command' step

I am running a bunch of windows commands as the build step in Jenkins using the "Execute Windows batch command" option. 在Jenkins中,我使用“执行Windows批处理命令”选项来运行一堆Windows命令作为构建步骤。 However, the build stops after executing some of the commands, ignoring the rest, and says "Finished: SUCCESS". 但是,在执行某些命令后,构建将停止,而忽略其余命令,并显示“ Finished:SUCCESS”。 Here's kind of how my "Execute Windows batch command" looks: 这是我的“执行Windows批处理命令”的样子:

xcopy source\dir dest\dir
7z x file_name.zip
cd extracted_dir_name
rmdir /s /q stale_output
command_to_be_run
another_command_to_be_run
post_processing_
copy_and_zip_commands_

Jenkins executes until another_command_to_be_run , and then just stops as if there are no other commands after that, and says "Finished: SUCCESS". Jenkins一直执行到another_command_to_be_run为止,然后停止,就好像之后没有其他命令一样,然后说“ Finished:SUCCESS”。 Why is this happening? 为什么会这样呢? How do I execute the post-processing commands? 如何执行后处理命令?

PS: command_to_be_run and another_command_to_be_run take more than a few seconds, but I don't know if that matters. PS: command_to_be_runanother_command_to_be_run花费了几秒钟的时间,但是我不知道这是否重要。

Edit: I've later tried commenting out another_command_to_be_run with REM , and then all the other post-processing commands run fine. 编辑:我后来尝试用REM注释掉another_command_to_be_run ,然后所有其他后处理命令运行正常。 Soooo Strange! 太奇怪了! Hope this rings any bells. 希望这能敲响钟声。 Thanks in advance..!!! 提前致谢..!!!

Most likely, one of the commands you are running is a .bat or .cmd file. 您运行的命令之一很可能是.bat或.cmd文件。 If you don't use the "call" keyword before calling one of those, your main script will stop after that point. 如果您在调用其中一个之前没有使用“ call”关键字,则主脚本将在此之后停止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在jenkins构建步骤的Windows10批处理命令中转义%? - How to escape % in windows10 batch command in jenkins build step? Jenkins Pipeline 无法在 Windows 从站中执行 SH 命令文件 - Jenkins Pipeline cannot execute SH command file in a Windows slave 使用Jenkins中的execute shell命令在Windows机器上运行git命令 - Using the execute shell command in Jenkins to run git commands on a Windows machine 如何使用 groovy 在 jenkins windows slave 上执行 CMD 命令? - How to execute CMD command on jenkins windows slave using groovy? Jenkins执行Windows批处理命令无法更改文件 - Jenkins Execute Windows batch command fails for file change exec.command 不在 windows (golang) 上执行 - exec.command does not execute on windows (golang) 詹金斯视窗 | 构建 > 执行 Windows 批处理命令 | 如何将文件夹和文件移动到根目录/工作区 - Jenkins Windows | Build > Execute Windows Batch Command | How to move folder and files into the Root Directory / Workspace Jenkins在Windows上可以使用哪些shell /命令行工具? - What shells/command line tools does Jenkins have available on windows? 在Jenkins中执行WINdows bat文件 - Execute WIndows bat file in Jenkins 如何从cygwin内部执行windows runas命令 - How does one execute the windows runas command from inside cygwin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM