command line runner & exit /b 1

using exit /b 1 to exit a .bat file causes TeamCity to report success.
Do you know how the exit code 1 could correctly be passed to TC?
when using exit 1 then it works correctly.
What exactly is TC doing when runner is command line?

2 comments
Comment actions Permalink

To start you process TeamCity uses JAVA API for staring processes from Commandline, environment variables and process arguments. If you are going to run .bat file it's recommenede to call cmd.exe explicitly.

Any way, you may consider sending TeamCity service messages from you script.
http://www.jetbrains.net/confluence/display/TCD4/Build+Script+Interaction+with+TeamCity

Could you please try running commandline cmd.exe with arguments /c <path to your script> other arguments
Thanks!

0
Comment actions Permalink

This is because the /B option do not terminate cmd.exe but only exit your script. As a result, cmd.exe reports that it had exit normally with exitcode 0.
http://www.ss64.com/nt/exit.html

We use some batch file with the command runner and do not have problem once we setup the exit code correctly.

0

Please sign in to leave a comment.