I have a Git repository with 3 classic branches (dev, staging, master).
I'm trying to setup a VCS, so that a build triggers only when a push is made to a specific subfolder in the repository.
Under the dev branch, I have 2 folders:
Now, I want TeamCity only to trigger a build when I push a change in the ServiceAPI folder, not the other one (ServiceWeb.Test).
I have tried to setup a few different configs (I figured this could be done using Branch Specification, but it doesn't work, or I'm doing it wrong).
In the VCS configuration I have Default branch set as dev
and I have Branch specification set as +:refs/heads/dev/ServiceAPI/*
Assuming that the Default branch is always active, I tried adding -:refs/heads/dev/* in the Branch specification to cancel it out, but it doesn't work.
I also tried to put a different branch than dev in Default branch, but then the trigger didn't work when pushing changes in the dev branch, regardless what is in Branch specification.
Then I tried excluding the ServiceApi.Test folder by inserting -:refs/heads/dev/ServiceAPI.Test/* to Branch specification, but that didn't work either. TeamCity builds when I push changes into either folder.
I hope I'm explaining the problem well enough. Please let me know if you need more information.
Any ideas would be most welcome.