Git short branch name in teamcity

Ömer Faruk Aplak picture Ömer Faruk Aplak · Dec 11, 2013 · Viewed 19.1k times · Source

I'm using teamcity 8.x.x version.I configured my Teamcity for continuous deployment. I'm need a feature branching deployment. I see this document "http://confluence.jetbrains.com/display/TCD8/Working+with+Feature+Branches".

I'm trying this document implementing on my Teamcity. I have a problem.

My deployment config use "OctoPack" (nuget). My nuget package needs build count and branch name. example: 1.0.0.356-feature-1.

I'm try this versioning,

%build.number%-%teamcity.build.vcs.branch.VCS_ROOT_ID% ----> 1.0.0.356-refs/head/feature-1

this version not support nuget versioning. nuget not comparative "/".

I need this,

%build.number%-%teamcity.build.vcs.SHORT_BRANCH_NAME.VCS_ROOT_ID% ---> 1.0.0.356-feature-1

how can I ?

Thanks

Answer

Pedro Pombeiro picture Pedro Pombeiro · Dec 13, 2013

I believe what you need is another variable. Try using %vcsroot.branch%. There is also %teamcity.build.branch%, but that one will contain "<default>" on the default branch. If you want more flexibility to choose exactly which part of the branch name gets selected, you can follow the instructions on this page:

http://confluence.jetbrains.com/display/TCD7/Working+with+Feature+Branches#WorkingwithFeatureBranches-branchSpec.