is there a way to clean up jobs in teamcity when the job is cancelled
Answered
I have a teamcity build that submits a job to the farm. However, when i cancel the build, the teamcity job is cancelled, but the job is in the farm is still running.
Is there a way to 'inject' some command so that i could do some cleanup and kill the job in the farm when the TC job is cancelled?
Thanks in advance.
Please sign in to leave a comment.
Hello!
You can set up a specific step to always run, even if build was cancelled:
https://www.jetbrains.com/help/teamcity/configuring-build-steps.html#ConfiguringBuildSteps-Executionpolicy ("Always, even if stop command was issued" option)
Therefore, you can write a script which will check if the job is still running and cancel it if required, each time a build ends. Would this approach work for you?
ya that should work.Thanks a lot.