我们将TFS2010用于源代码控制,将TeamCity 8.x用于CI。在我们的项目中,我们Main
为发布和错误修复以及Dev
大部分开发提供分支。两个分支的构建步骤相同。我们需要完成一些构建配置:
我似乎无法让TeamCity在单个分支上签出并仅在签入到的分支上运行build。
第一次尝试:我添加了一个VCS根目录,指向$/Root
包含Main
和Dev
分支的VCS根目录,并创建了结帐规则:
第一次签到Main
工作正常。签入Dev
失败后将出现以下情况:
where DoNotExportAttribute
is the file that was modified in the Dev branch. Even if I have checkbox against "Clean all files in the checkout directory before the build".
My second attempt was to add both of the branches as VCS roots:
But this caused checkout of both branches into the same directory and whatever was checkout first was overwritten by second branch.
Is there a remedy for our case without creating separate configurations for every branch? (we started from config-per-branch, but that proven to be maintenance heavy for the number of steps we do in build)
If I understand correctly, you're trying to use a single TeamCity project for both your main and your branch builds. I would not recommend doing that. By re-using the same project for both your main and your branch builds, you will be sharing version numbers between two different beasts. Version 1.1.4 of the build might be a main build while version 1.1.5 might be a branch build.
By looking at the artifacts created by the build, it will also be difficult to identify which source code was the one selected and included into that artifact. Is the executable a main or a branch executable?
解决主要vs分支问题的方法是创建一个“模板”项目,其中包含我们所有的构建配置(每个构建配置都设置为“构建配置模板”,因此可以在一个位置中进行更改)以构建我们的软件。通过复制此“模板”项目并将VCS根目录设置为适当的目录位置,可以创建主项目和分支项目。
我们运行五个构建代理,每个构建花费相当多的时间。如果主分支和任何一个分支恰巧同时被修改,则每个分支都有单独的项目使我们可以并行运行构建,而对于一个项目,构建将按顺序进行。
希望这可以帮助。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句