Search code examples
batch-filecmdtfs-2015build-definition

How to Rerun failed cmds in a build defintion


I have a build definition,which contains a couple of cmds that run the same exe(through the commandline task) but with different params. At the end of the run of the build definition I want to rerun the failed cmds. I can write a batch file where I can check the status with %ERRORLEVEL% after each cmd run, but how do I rerun them?


Solution

  • For the above scenario I tweaked my code a bit. I isolated the main() method completely and put it inside a simple try catch block and an iterator that takes its value from a config file. It will catch as long as the iterator allows and then it will throw the exception. For now this is working for me. Lets hope MS visual studio team gives some thought about the request raised!! Thanks anyways!!