TeamCity 分支概念是否可以应用于带有构建链的 Subversion? [英] Can TeamCity branches concept be applied to Subversion with Build Chains?

查看:40
本文介绍了TeamCity 分支概念是否可以应用于带有构建链的 Subversion?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们通过指向这里提到的 tags 在 subversion 中使用 TeamCity 的分支概念取得了一些成功 https://stackoverflow.com/a/6875151/2416394 尽管我们知道这是 DVCS 的主要内容,如 git.

We had some success using the branches concept of TeamCity in subversion by pointing to tags like mentioned here https://stackoverflow.com/a/6875151/2416394 although we are aware that this is primary for DVCS like git.

我们通过提供项目参数 %Tag% 扩展了链接中的答案,该参数成为结帐规则的一部分.所以我们的 SVN Root 是 http://myserver/svn/tags/ 并且结帐规则是+:%Tag%=>.每次我们结帐时都会添加一个新标签作为分支"并构建源代码,这很好

We've extended the answer from the link by providing a project parameter %Tag% which became part of the checkout rule. So our SVN Root is http://myserver/svn/tags/ and the checkout rule is +:%Tag%=>. Each time we checkout a new tag is added as "branch" and build the source, this is fine

现在我们开始尝试链式构建.假设我有这些配置:

Now we started experimenting with chained builds. Let's say I have those configs:

  • 源代码构建
  • 安装程序-精简版
  • 安装程序完整

两个安装程序都需要源,都将其作为快照和工件依赖项.主要问题是:Tag 是 Source Build 的必需参数,但不是其他参数,我不想将所有属性复制到每个配置.因此,每当我触发任何安装程序时,源代码都会在 %Tag% 设置为空的情况下构建.

Both Installers need source, both have it as snapshot and artifact dependency. The main problem is: Tag is a mandatory parameter for Source Build but not for the other, I don't want to replicate all properties to each config. So whenever I trigger any installer, source gets build with %Tag% set to empty.

然后导致构建http://myserver/svn/tags/%Tag% 带有空标签.这会检查一个工作区中默认"分支中的所有标签,但由于结构不同,并且无论如何都会变大,因此无法构建.

Which then results in building http://myserver/svn/tags/%Tag% with an empty tag. This checks out all tags in the "Default" branch in one workspace which later fails to build as the structure is different and anyway way to large.

推荐答案

由于 Installer-Lite 和 Installer-Full 对 Source Build 有快照依赖,它们可以使用 %Tag% 变量引用code>%dep.SourceBuild.Tag%(其中 SourceBuild 是 Source Build 配置的 ID).

Since Installer-Lite and Installer-Full have snapshot dependencies on Source Build, they can refer to its %Tag% variable using %dep.SourceBuild.Tag% (where SourceBuild is the ID of the Source Build config).

因此,您可以执行以下操作之一:

Hence, you can do one of the following:

  • 选项 1:Installer-Lite 中的 checkout 规则变为 +:%dep.SourceBuild.Tag%=>.
    • 这更简短,但可读性稍差
    • 要设置的东西更多,但结帐规则是对称的,因此维护人员不会感到惊讶

    这篇关于TeamCity 分支概念是否可以应用于带有构建链的 Subversion?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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