Only build changed folder

/
|_ foo/
|_ file.txt
|_ bar/ |_ file.txt |_ baz/
|_ file.txt

My project structured as above where every folder has its own pull request verification build. At the moment, a PR contains only bar change will trigger foo and baz as well. Instead I want Teamcity to run only PR build on bar. Is it possible? Thank you  

0
3 comments
Avatar
Fedor Rumyantsev

Hello,

Have you considered setting up checkout rules for your build configurations? These limit what would be checked out during the build, and also "hide" irrelevant commits from the build configurations, so if the change does not concern "bar" folder, it will not be visible in the configuration that builds "bar".

1

I have been trying to do this. The checkout rule I try to do look like this. Teamcity will only checkout changed directory, for ex: If content of bar folder is changed, only checkout bar folder. If content of foo and bar directory changed, only checkout foo and bar. However, I don't find such dynamic checkout rule doable. 

0
Avatar
Fedor Rumyantsev
Hello,

Can you please elaborate on your use case where this is needed? Usually, when a monorepo is being built, and there are, for example, builds A and B which build contents of "foo" and "bar" folders, respectively, A is set to checkout only "foo" and B only "bar", for the desired effect. This way if PR affects just "foo", only A build which checks it out will be triggered.
0

Please sign in to leave a comment.