Select Git branch for TeamCity Build

一曲冷凌霜 提交于 2019-11-28 03:08:30

Based on @biswajit-86 's feedback and some other information I found while googling this, I was able to get this to work. Here's what I did (image-heavy, sorry). It's based on Team City 8.2 which seems to be set up a little differently than the examples I came across.

1) Set up a VCS root. Key here is the %BranchName% parameter.

2) Create a Build template and use the VCS root that was just created. I also added an MSBuild step as all of my builds need to run this.

3) Create a new build, based on the template. As you can see here, the %BrachName% parameter that was created in step 1 is available.

4) If you need to change this later, it's available here

And that's pretty much it. For my CI build, I left the branch name empty so any branch that is checked in triggers the MSBuild step. For my QA build, I pass in "develop" as shown here and I have this set up on a daily schedule. I also have a "release" build set up, but based on our naming conventions it looks like I need to update the build to point to the specific branch per release.

Biswajit_86

You can parameterize the "Ref name" of the git VCS setup. What this means is you declare a variable of the form %variable.name% in your build, create a build parameter under the "configuration parameter:" category.

For each build target set this value and you should be able to pick the specific branch that you want to run the target for.

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