为TeamCity Build选择Git分支 [英] Select Git branch for TeamCity Build

查看:1606
本文介绍了为TeamCity Build选择Git分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的VCS根目录(Git)设置为Default:master,并且分行规格是

  +:refs / heads / develop 
+:refs / heads / feature / *
+:refs / heads / hotfix / *
+:refs / heads / master
+:refs / heads / release / *

我有一个CI构建设置,可以自动构建任何已签入的内容,这正是我想要的。



我想要做的是针对开发分支创建预定的QA构建/部署。我看到,如果单击运行按钮旁边的省略号,我可以在更改选项卡上选择分支,但我无法确定如何制作此粘贴。这是可能的,或者我正在做这个错误?



谢谢,



Joe

解决方案

基于@ biswajit-86的反馈和我在Google上搜索时发现的一些其他信息,我能够得到这个工作。这就是我所做的(形象沉重,抱歉)。它基于Team City 8.2,它似乎与我遇到的示例稍有不同。

<1>设置VCS根目录。这里的关键是%BranchName%参数。





3)根据模板创建一个新版本。正如你在这里看到的,在步骤1中创建的%BrachName%参数是可用的。





4)如果您需要更改这稍后,它可在这里





这就是它。对于我的CI构建,我将分支名称留空,以便检入的任何分支触发MSBuild步骤。对于我的QA构建,我通过如此处所示的开发,并且每天安排一次。我也有一个发布版本的设置,但基于我们的命名约定,它看起来像我需要更新构建指向每个版本的特定分支。


I'm wondering how to select the branch to build against using Team City 8.1.

My VCS root (Git) is set to Default: "master" and Branch specifications are

+:refs/heads/develop
+:refs/heads/feature/*
+:refs/heads/hotfix/*
+:refs/heads/master
+:refs/heads/release/*

I have a CI build set up that automatically builds anything that is checked in, which is working exactly how I want.

What I'd like to do is create a scheduled QA build/deployment against the "develop" branch. I see that if I click the ellipsis next to the run button, I can choose the branch on the "Changes" tab, but I'm unable to determine how to make this "stick". Is this possible, or am I going about this wrong?

Thanks,

Joe

解决方案

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.

这篇关于为TeamCity Build选择Git分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆