Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to trigger a batch file in Jenkins without waiting for batch execution results and status

I have a Jenkins job which is building /packaging/ deploying .NET project. I use "Clean Before checkout" git property for each build.

Finally, I'm executing a batch file. This batch file scanning sonar Qube MSBuild, c# analysis and update the code quality results. But It is taking a long time and I don't want to increment Jenkins job's total execution time from 1 minute to 5 minutes. Developers are thinking so the deployment is taking a long time and not finished yet.

I want to run this batch file independent from the Jenkins job and don't want to see the console output in Jenkins. How could I do this without creating a new Jenkins job for each Jenkins project (upstream/downstream projects)

like image 952
Ozgur Kaya Avatar asked Sep 06 '25 03:09

Ozgur Kaya


1 Answers

you need to use the start cmd command,for example:

start YourBatch.bat

This will open a new CMD window and Jenkins won't wait for result.

Bare in mind that if you get an exit code different than 0, it won't fail the build.

like image 138
Shahar Hamuzim Rajuan Avatar answered Sep 07 '25 21:09

Shahar Hamuzim Rajuan