Reputation: 550
I am running a bunch of windows commands as the build step in Jenkins using the "Execute Windows batch command" option. However, the build stops after executing some of the commands, ignoring the rest, and says "Finished: SUCCESS". Here's kind of how my "Execute Windows batch command" looks:
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".
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.
Edit:
I've later tried commenting out another_command_to_be_run
with REM
, and then all the other post-processing commands run fine. Soooo Strange! Hope this rings any bells. Thanks in advance..!!!
Upvotes: 4
Views: 5073
Reputation: 468
Most likely, one of the commands you are running is a .bat or .cmd file. If you don't use the "call" keyword before calling one of those, your main script will stop after that point.
Upvotes: 7