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?

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.

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

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.

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


Please sign in to leave a comment.