Configure current build configuration to build from feature branch instead of master

Hello, I have a build configuration that builds only from the master branch of a BitBucket repo. I have been asked to configure TC to build from a feature branch of this repo. This is likely a short term issue and will not need to be done again after pushing this feature build.

I am still new to TC and am unsure from reading the documentation if I'm making changes in the right place. In the “Edit VCS Root” screen I have the master branch defined under Branch Specification. Do I need to add the feature branch as outlined below?

Is there anywhere else that I need to define the feature branch? And after doing so, how can I run a custom build from this branch?

0
3 comments
Hi Neil,

Once you've configured the branch specification, TeamCity will start to monitor these branches for changes. If your build configuration has a VCS trigger and a change is found in some branch (https://www.jetbrains.com/help/teamcity/2024.07/configuring-vcs-triggers.html#branch-filter-1), TeamCity will trigger a build in this branch. From the build configuration home page you'll also be able to filter the history, change log, pending changes and issue log by the branch name. Branch names will also appear in the custom build dialog, so you'll be able to manually trigger a custom build on a branch too. For more information about how to manually trigger a custom build, please refer to https://www.jetbrains.com/help/teamcity/running-custom-build.html.

In your case, if you want to trigger the build only from the feature branch, you can use the Branch Filter. For more details, refer to https://www.jetbrains.com/help/teamcity/2024.07/branch-filter.html#Branch+Filter+Format.
0

Thank you very much for the information. I have configured the VCS Root and Branch Filter to include my feature branch, the only issue was the formatting of the branch name in the Branch Specifications and Branch FIlters fields. It had to be in the format +:refs/heads/feature/my_feature_branch, as just using +:feature/my_feature_branch was not sufficient. Thanks for your help!

0
Hi Neil,

You are welcome.

Please do not hesitate to reach out to me if you have any further inquiries regarding this matter.
0

Please sign in to leave a comment.