Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I cancel a TeamCity build from my msbuild script?

TeamCity allows me to report back from my MsBuild script using the ##teamcity interaction. I can use this to tell TeamCity that the build has FAILED, or indeed SUCCEEDED, however I would like to tell it to CANCEL the build instead. Does anyone know of a way to do this?

I can use this to inform TeamCity of failure...

<Message Text="##teamcity[buildStatus status='FAILURE']" Condition="Something==SomeCondition" />

I would love to do this...

<Message Text="##teamcity[buildStatus status='CANCEL']" Condition="Something==SomeCondition" />

I've tried out the TeamCity Service Tasks but nothing thus far.

EDIT:

So it seems this feature is not available, although a workaround http request can be used to cancel a build. There is also a feature request for Cancelling a build the TC website.

like image 383
Siy Williams Avatar asked Nov 08 '10 16:11

Siy Williams


1 Answers

According to JetBrains issue tracker and release page, since TeamCity 2019.1 EAP 1 builds can be stopped with service message as in:

##teamcity[buildStop comment='canceling comment' readdToQueue='true']
like image 100
aprelev Avatar answered Sep 30 '22 06:09

aprelev