Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git pull request branch name in teamcity


I configured git pull requests my teamcity server for QA testing environment. If I use TeamCity feature branching integration, I can get branch name with this property: %teamcity.build.branch%.

When use pull request, the %teamcity.build.branch% property return pull request number (1,2,3 etc).

How can I get pull request branch name?

like image 966
Ömer Faruk Aplak Avatar asked May 15 '14 10:05

Ömer Faruk Aplak


People also ask

How do I create a specific branch in TeamCity?

To run builds from a specific branch or set of branches automatically, configure build triggers. You can also filter history by a branch name if you're interested in a particular branch. TeamCity assigns a branch label to the builds from the default branch too.

What is branch filter in TeamCity?

Branch filter description. Version Control Settings of a build configuration. Limit the set of branches available for the build configuration. This branch filter is applied before any other branch filter and limits branches shown in the custom build dialog, as well as branches visible to triggers and build features.


1 Answers

Parameter teamcity.build.branch is a logical branch, i.e. it's a part of a branch from your branch specification matched by *.

There is another parameter teamcity.build.vcs.branch.<VCS root ID> which contains full Git branch name. Seems this is what you need.

You can read more on this in documentation: http://confluence.jetbrains.com/display/TCD8/Predefined+Build+Parameters#PredefinedBuildParameters-BranchRelatedParameters

like image 77
Pavel Sher Avatar answered Sep 30 '22 12:09

Pavel Sher