[英]Can TeamCity branches concept be applied to Subversion with Build Chains?
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. 我们通过使用TeamCity的分支概念在颠覆中取得了一些成功,方法是指向此处提到的
tags
https://stackoverflow.com/a/6875151/2416394,尽管我们知道这是git等DVCS
主要基础。
We've extended the answer from the link by providing a project parameter %Tag%
which became part of the checkout rule. 通过提供项目参数
%Tag%
已成为结帐规则的一部分),我们从链接扩展了答案。 So our SVN Root is http://myserver/svn/tags/
and the checkout rule is +:%Tag%=>.
因此,我们的SVN根目录为
http://myserver/svn/tags/
,结帐规则为+:%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:
假设我有这些配置:
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. 主要问题是:
Tag
是Source Build的必需参数,而不是其他参数,我不想将所有属性复制到每个配置。 So whenever I trigger any installer, source gets build with %Tag%
set to empty. 因此,每当我触发任何安装程序时,都将
%Tag%
设置为空来构建源。
Which then results in building http://myserver/svn/tags/%Tag%
with an empty tag. 然后,这会生成带有空标记的
http://myserver/svn/tags/%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. 这会在一个工作空间中检出“默认”分支中的所有标签,由于结构不同并且反而变大了,该工作空间随后无法构建。
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). 由于Installer-Lite和Installer-Full在Source Build上具有快照依赖性,因此它们可以使用
%dep.SourceBuild.Tag%
(其中SourceBuild
是Source Build配置的ID)引用其%Tag%
变量。
Hence, you can do one of the following: 因此,您可以执行以下任一操作:
+:%dep.SourceBuild.Tag%=>.
+:%dep.SourceBuild.Tag%=>.
%Tag%
variable, its value set to %dep.SourceBuild.Tag%
, and then the same checkout rule as Source Build, ie +:%Tag%=>.
%Tag%
变量,其值设置为%dep.SourceBuild.Tag%
,然后设置与Source Build相同的签出规则,即+:%Tag%=>.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.