Change branch name when running custom build in Teamcity

自作多情 提交于 2019-12-02 17:56:38

问题


Given I have Teamcity job with Git VCS root with default branch which can be changed with branch-name parameter:

When I e.g. set branch-name to develop in admin screen, go back to build configuration home and run custom build where I change branch-name parameter to master then I get:

Why is that? What should I change, so that I don't get this message and I can change branch when running custom build?

The reason for this is I want to build and deploy software artifacts from any feature branch


回答1:


the Teamcity has an opportunity for monitoring the branches and runs built to custom branch.

Firstly, edit your VCS Root and add follows:

Default branch: refs/heads/master
Branch specification:+:refs/heads/*

now the TC will check changes by some interval.

We are sets the master as default branch. and when we run the build with default parameters, the build will start to master branch

If you are want to start build with custom branch then press Run... -> Changes -> select your custom branch from Build Branch parameter.

If you want to run build from API, or want to reverse the build branch parameter, just set Configuration parameters with key teamcity.build.branch and value what you want



来源:https://stackoverflow.com/questions/52150236/change-branch-name-when-running-custom-build-in-teamcity

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