I have a Git repository with 3 classic branches (dev, staging, master). I'm trying to setup a VCS in TeamCity 8.1.x, so that a build triggers only when a push is made to a specific subfolder in the repository.
Example: Under the dev branch, I have 2 folders:
(dev)
- ServiceAPI/
- ServiceAPI.Test/
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
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.
Regards, Gunnar
Updated: This issue was resolved, but I can't remember how exactly and I'm too lazy to check it out. If however, someone encounters this and can't figure it out, feel free to let me know and I can most likely reproduce the problem and have a detailed answer if needed.