简体   繁体   English

TeamCity + GitHub(每个分支的构建配置)

[英]TeamCity + GitHub (Build Config per branch)

TeamCity Setup: TeamCity设置:

Project(CenterProj) 项目(CenterProj)

  • Build Configuration (Master Branch) 构建配置(主分支)
  • Build Configuration (Dev Branch) 构建配置(Dev分支)

VCS(GitHub) Setup (Repo: CenterProj): VCS(GitHub)设置(回购:CenterProj):

  • Master Branch 师父分公司
  • Dev Branch 开发部

Site Setup: 网站设置:

  • dev.centerproj(relates to dev branch) dev.centerproj(与dev分支有关)
  • qa.centerproj(relates to master branch) qa.centerproj(与master分支相关)

I have yet to figure out how I can have 1 VCS Root connection going to the CenterProj Repo, and then trigger the 2 build configs based on commit/merge to their individual branches. 我还没有弄清楚如何将1个VCS Root连接到CenterProj Repo,然后根据对它们各自分支的提交/合并触发2个构建配置。

  • Example: commit code to Dev branch, TC triggers Build Configuration(Dev) and it goes out to dev.x. 示例:将代码提交到Dev分支,TC触发Build Configuration(Dev),然后发送到dev.x。 I think merge that commit to Master, and it then triggers the Build Configuration(Master) which goes out to qa.x. 我认为合并提交到Master的提交,然后触发生成配置(Master),然后发送到qa.x。

So far I'm getting continual "Pending" builds waiting on dev when I commit/merge to master or pending in Master when I commit/merge into Dev. 到目前为止,当我提交/合并到master时,我将获得持续的“ Pending”构建等待开发,而当我提交/合并到Dev中时,将在Master中等待。

Suggestions? 有什么建议吗?

You need to specify a trigger rule for each build configuration, and in there limit which branch will trigger your build. 您需要为每个构建配置指定一个触发规则,并限制在哪个分支中触发您的构建。 As far as the "Pending" changes, they will appear on top of both build configuration because you are sharing the same VSC root, no need to worry about that. 至于“挂起”更改,它们将出现在两个构建配置的顶部,因为您共享的是同一VSC根目录,无需担心。

  1. In the first screenshot, your VSC configuration, set your branch specifications to "+:refs/heads/*" 在第一个屏幕快照中,即您的VSC配置,将分支规范设置为“ +:refs / heads / *”
  2. In the second screenshot, you already have a value in the "Branch Filter," just set that to "+:dev" 在第二个屏幕截图中,“分支过滤器”中已经有一个值,只需将其设置为“ +:dev”
  3. In the last screenshot set the "Branch Filter" to "+:master" 在上一个屏幕截图中,将“分支过滤器”设置为“ +:master”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM