Jenkins windows slave - How do I catch windows batch file errors

1,797 views
Skip to first unread message

rakhee Kulkarni

unread,
Apr 30, 2013, 6:59:26 PM4/30/13
to jenkins...@googlegroups.com
All,

I have build running on a windows slave which gets launched by a windows batch file. if the builds fail I do not see Jenkins catching the error. Please advise.

Thanks,
Rakhee

kcd

unread,
May 1, 2013, 5:36:42 PM5/1/13
to jenkins...@googlegroups.com
Jenkins checks the exit code. Run your batch file and try

echo %errorlevel%

Your batch file needs to exit with a non 0 code, i.e.

exit 1

Be aware jenkins can only check the errorlevel left by the last command so the following will succeed because the echo returns 0

somebadcommand
echo hello

Hope that helps
Reply all
Reply to author
Forward
0 new messages