How to pass branch name to build.xml

為{幸葍}努か 提交于 2020-01-05 04:55:23

问题


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.


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/20045492/how-to-pass-branch-name-to-build-xml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!