How to restart the teamcity agent host without causing cancelled build

Hi!
I need to restart the teamcity agent host (the server itself) after testing the build.
When I added a restart command at the end of my build steps, the artifact publishing gets cancelled.
The report says it was cancelled.

I then added a timer for the shutdown to give ample time for the artifact publishing to finish.
It resulted in a cancelled build because the agent starts building again (from the build queue) and the shutdown kicks in.

Any suggestions?

1 comment
Comment actions Permalink

Hi Christian

We have this feature request logged in TW-19712, please vote.

This logic can be implemented as a custom plugin. Let us know if you're interesning in API details.

0

Please sign in to leave a comment.