Jenkins running multiple batch files at once
batch-file, jenkins, multithreading
Solution
Try using "call batchfile.bat" That should block until the batch file is done running.
Problem
I'm looking for a way to either pause Jenkins or have Jenkins complete a task from a batch file before starting another batch process. Basically what I want is something similar to running: ``` start /wait batchfile.bat ``` but when I run this Jenkins just hangs and the process never actually completes. When I run something like this: ``` run %startpath%\firstbatch.bat run %startpath%\secondbatch.bat ``` Jenkins runs both batch files in different threads and this causes a big problem for me. I need the batch processes to complete because they cook and copy assets. The final batch that gets triggered zips the assets and sends them on their way, but if the assets aren't done being copied, the zip starts without all the files in the directory. The only other way I can think of around this is to have each batch in a different build and adding a quiet period to Jenkins but that would just be a guess to how long the batch scripts are actually running for. Thanks in advance.