RTC build result exit code
I have tested the "command line" build definition with JBE and found the following fact:
1.RTC build definition excutes command: cmd /c a.bat a.bat: echo start the build result is successful without error code massage C:\IBM\JAZZ\maven\apache-maven-2.2.1-bin\bin\my-app>echo start 2.RTC build definition excutes command: cmd /c a.bat a.bat: echo start test2.bat: exit /b 1 the build result is successful without error code massage C:\IBM\JAZZ\maven\apache-maven-2.2.1-bin\bin\my-app>echo start 3.RTC build definition excutes command: cmd /c a.bat a.bat: echo start test2.bat: cmd /c exit /b 1 the build result is failed with "error code =1" massage C:\IBM\JAZZ\maven\apache-maven-2.2.1-bin\bin\my-app>echo start do you have any idea why these 3 conditions have different results? and why in case 1, the "stop" still echo out after an exit command? Thanks. |
One answer
I have tested the "command line" build definition with JBE and found the following fact: echo start the build result is successful without error code massage C:\IBM\JAZZ\maven\apache-maven-2.2.1-bin\bin\my-app>echo start 2.RTC build definition excutes command: cmd /c a.bat a.bat: echo start test2.bat: exit /b 1 the build result is successful without error code massage C:\IBM\JAZZ\maven\apache-maven-2.2.1-bin\bin\my-app>echo start 3.RTC build definition excutes command: cmd /c a.bat a.bat: echo start test2.bat: cmd /c exit /b 1 the build result is failed with "error code =1" massage C:\IBM\JAZZ\maven\apache-maven-2.2.1-bin\bin\my-app>echo start do you have any idea why these 3 conditions have different results? and why in case 1, the "stop" still echo out after an exit command? Thanks. Hi, The various outcomes are a result of Windows behavior. You can get the same results by just executing the batch files shown in a Windows command window instead of running through a build. There are a few Windows documentation pages that help explain the behavior. cmd exit call A couple of things I noticed in the examples. The exit code can be checked by echoing the ERRORLEVEL. I believe that you may have wanted to use a 'call' statement in your a.bat files to call the test2.bat instead of directly invoking it. Brent Ulbricht RTC Build Lead |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.