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.

0
2 comments
Avatar
Fedor Rumyantsev

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?

0
Avatar
Permanently deleted user

ya that should work.Thanks a lot.

 

0

Please sign in to leave a comment.