TeamCity force clean check-out directory when certain types of files get checked in


We're using TeamCity 9 now.

Is it possible to set up a rule in our build configuration so that TC would force a clean check-out directory before a build if the change list triggers this build contains certain types of files?

For example, if I check in a file named as *.clean, we would like the TeamCity agent performs check-out directory cleaning before running the build. We don't want it get cleaned up every time a build gets triggered because that would take much longer and not acceptable in our dev environment.

I went through the "Build Features" in Build configuration but I didn't find anything there.


Comment actions Permalink

What is your use case? Maybe you can reach it with swabra.

Comment actions Permalink

Thanks for your reply, I'm not sure how I can set a rule like that in Swabra.

My user case is basically like the following:
- if there is a file (*.clean) checked in under directory or any of subdirectories of \mySource. In other words, the code changes we make, which will trigger a build, contain a file named like *.clean.
- then perform a clean up of check-out directory
- run the build

Is that something we can do by using Swabra?
It seems to me that Swabra can not monitor files with certain extensions. And it's not able to monitor the change list.

Comment actions Permalink

Hi Yang,

I do not think that Swabra can help in this case. Won't it be an option to run custom build with option "clean all files in the checkout directory before the build" instead of using *.clean file? To automate the process you can use REST API request.


Please sign in to leave a comment.