TeamCity构建依赖关系并选择正确的分支 [英] TeamCity build dependencies and choosing the correct branch

查看:425
本文介绍了TeamCity构建依赖关系并选择正确的分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含三种构建配置的项目:
$ b


  1. 集成

  2. 部署开发

  3. 部署发布

构建配置2和3通过快照依赖于1。 p>

有3个VCS根:


  1. Git - 所有)

  2. Git - 开发(与构建配置2一起使用)

  3. b

默认分支和分支规格如下:

Git - 全部



默认分支:


开发


分支规范:


+:refs / heads /(develop)< br>
+:refs / heads /(master)

+:refs / heads /(feature /

+:refs / heads /(hotfix / b):
+:refs / heads /(release)

+:refs / heads /(support / *)
blockquote>

Git - 开发



默认分支:


开发


分支规格:
$ b


+ :refs / heads /(develop)

Git - Master



默认分支:


master

分支规格:

lockquote

+:refs / heads /(master)




这是个问题......当我为第三个构建配置运行构建时,我希望依赖关系检查主分支上的集成构建。它没有做,并将始终使用集成构建配置(目前正在开发)的默认分支。



有没有办法实现我想要的?




  • 拥有一个集成构建配置

  • 具有独立的构建配置,它仅依赖于开发分支更新
  • li>
  • 拥有一个独立的构建配置,它仅依赖于主分支更新



我完成的方式它过去涉及在一个构建配置中使用多个CVS端点,这似乎也是错误的,如果可能的话,我想避免这种情况。 解决方案

我会建议使用分支规格和VCS触发器的变量。这允许您重新使用VCS根目录,同时仍然可以灵活地选择每个构建配置中的值。


I have a single project with three build configurations:

  1. Integration
  2. Deploy Dev
  3. Deploy Release

Build configs 2 and 3 are dependent on 1 via a snapshot.

There are 3 VCS roots:

  1. Git - All (used with build config 1)
  2. Git - Develop (used with build config 2)
  3. Git - Master (used with build config 3)

The default branch and branch specs are as follows:

Git - All

default branch:

develop

branch spec:

+:refs/heads/(develop)
+:refs/heads/(master)
+:refs/heads/(feature/)
+:refs/heads/(hotfix/
)
+:refs/heads/(release)
+:refs/heads/(support/*)

Git - Develop

default branch:

develop

branch spec:

+:refs/heads/(develop)

Git - Master

default branch:

master

branch spec:

+:refs/heads/(master)

Here is the problem...

When I run a build for the third build config, I want the dependency to check for integration builds on the master branch. It is not doing and will always use the default branch of the integration build config (currently develop).

Is there a way to achieve what I want?

  • Have a single integration build config
  • Have a separate build config that is dependent on only develop branch updates
  • Have a separate build config that is dependent on only master branch updates

The way I have done it in the past involved using multiple CVS end points on a single build config, which also seems wrong and I wanted to avoid that if possible.

解决方案

I would suggest using a variable for branch spec and VCS trigger. That allows you to reuse the VCS root, while still giving you the flexibility to choose the values in each build configuration.

这篇关于TeamCity构建依赖关系并选择正确的分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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