Removing clean-up rules from build configuration template

Answered

In TeamCity 2018 I had some build configuration templates that defined their own clean-up rules. I've upgraded to 2021 and it looks like this was deprecated, though still partially supported for legacy reason. I'm fine with the deprecation and would like to not use a feature that TeamCity isn't keen on me using, but how do I now remove the clean-up from the templates? I can see the rules as being an inherited rule of the build configurations that implement that template, and I can see a way to edit that clean-up rule, but no way to remove it. Thoughts?

3 comments
Comment actions Permalink

Hello!

Unfortunately, yes, when the clean-up rules on build configuration templates were deprecated, ability to edit them via UI was lost. As a workaround, you could modify the XML files representing the templates which may be found on the following path:

<Data Directory>\config\projects\<project ID>\buildTypes\<template ID>

Specifically, you would need to remove the following section:

<cleanup>
...
</cleanup>

The change should be applied automatically in a few minutes after the file is modified (TeamCity will re-read the XML file in the background once the change is detected). Could you please let me know if this works for you?

Also, project rules have priority over the template ones, so, unless there are no rules defined on the project level, template rules would not have an effect. 

0
Comment actions Permalink

See also YouTrack task TW-72196 about the problem.

0
Comment actions Permalink

Thanks.

0

Please sign in to leave a comment.