Branch wildcard matching
Given the following naming convention:
SubModule/vX.Y.Z/main
SubModule/vX.Y.Z/Feature1
SubModule/vX.Y.Z/Feature2
Is there any way I can create a triggered build to capture branches ending with /main? I have tried +:refs/heads/SubModule/*/main, but that doesn't seem to work.
Please sign in to leave a comment.
Hi Stefan,
If you're using a branch specification in the VCS root like:
+:refs/heads/SubModule/*/main, then it should work as expected.For more details please refer to Wildcards.
If this does not apply to your case, could you please share:
- A screenshot of your branch specification settings,
- The build trigger rules you have configured.
Also, could you provide more details on what you meant by "that doesn't seem to work"?
- What exactly have you tried so far?
- What behavior are you expecting, and what is actually happening?
Additionally, please collect and share the following logs around the time the issue occurs
- teamcity-server.log
- teamcity-trigger.log
Best Regards,
Tom
Hi Tom,
Apologies for the late reply. Is there somewhere I can upload these privately for you?
Regards,
Stefan
With regards to “it doesn't work”, I can perhaps clarify that slightly. We have a nightly build which we want to trigger on any branch following the naming convention outlined above (SubModule/vX.Y.Z/main). So, in our VCS settings we have:
Default branch: refs/heads/master
Branch specification: +:refs/heads/SubModule/vX.Y.Z/main
In our trigger, we have the same specification as in branch specification.
This triggers fine. However, when we change the branch specification to +:refs/heads/SubModule/*/main, the trigger either doesn't work. We have tried various way of defining the branch specification (eg: +:refs/heads/SubModule/*/main, +:refs/heads/SubModule/v3.0.0.*/main), but the triggered build either doesn't start or it start on the default branch. We would expect it to trigger on a branch called SubModule/v3.0.0.33/main
I have finally got this to work. It was a matter of incorrect pattern matching between the branch specification and trigger.