corvax
corvax

Reputation: 1145

How to pass branch name to build.xml

Say, I have this branch specification: +:refs/heads/* and I want to get branch name in build.xml. Any parameters like ${vcsroot.branch} return string env.branch.

Upvotes: 1

Views: 1480

Answers (2)

Welsh
Welsh

Reputation: 5468

You want to add an Environment Variable called something like env.branch then set its value to %teamcity.build.branch% then in your build.xml you can read it in using something like:

<property environment="env"/>
${env.branch}

Assuming this is ant for the last part.

Upvotes: 4

Pavel Sher
Pavel Sher

Reputation: 2211

Branch related parameters are described in TeamCity documentation: http://confluence.jetbrains.com/display/TCD8/Predefined+Build+Parameters#PredefinedBuildParameters-BranchRelatedParameters

Upvotes: 0

Related Questions