简体   繁体   English

如何在TeamCity中重新组合构建?

[英]How to recombine builds in TeamCity?

We have a lot of tests. 我们有很多测试。 I can break these up so that they run on seperate agents after an initial compile build happens, but is there a way I can recombine these results? 我可以打破这些,以便在初始编译构建发生后运行在单独的代理上,但有没有办法可以重新组合这些结果? Having 8 build configurations that all need to be green makes it hard to see if you've got one ubergreen build. 有8个构建配置都需要绿色,这很难看出你是否有一个ubergreen构建。

Is there a way in TeamCity to recombine / join builds once we've split them out? TeamCity中有一种方法可以在我们拆分后重新组合/加入构建吗? TW-9990 might help - allowing ANDs in the dependencies. TW-9990可能有所帮助 - 允许依赖项中的AND。

We found the answer which certainly works from TeamCity 5: 我们找到了可以从TeamCity 5获得的答案:

  1. One compile build, 一个编译版本,
  2. N test only builds that take compile.zip!** and copy to where the compile output would normally be. N测试只构建带有compile.zip!**并复制到编译输出通常的位置。 (via a template) (通过模板)

  3. Consolidated finish: 合并完成:

    • Finish Build Trigger: Wait for a successful build in: ... 完成构建触发器:等待成功构建:...
    • Snapshot Dependencies: Do not run new build if there is a suitable one Only use successful builds from suitable ones 快照依赖项:如果有合适的构建,请不要运行新构建仅使用合适的构建版本

This all seems to work nicely and the whole shbang is easily copied for branches etc. Am very happy - this has worked well for us for many months now. 这一切看起来效果都很好,整个shbang很容易被复制到分支机构等。我很高兴 - 这对我们来说已经好几个月了。

No idea how to do that natively. 不知道该如何做到这一点。 Here's my first thoughts on how I would try and tackle such a thing though: 以下是我对如何尝试解决此类问题的初步想法:

  • Saving test results to files 将测试结果保存到文件
  • Publishing the test result files as build artifacts 将测试结果文件发布为构建工件
  • Creating a 'Merge build' 创建“合并构建”
  • Adding artifact dependency onto the individual test projects 将工件依赖项添加到各个测试项目中
  • Writing a custom 'build' script using something like (N)Ant. 使用类似(N)Ant的东西编写自定义的“构建”脚本。 This would parse the individual test results and publish the results as per the TC KB 这将解析单个测试结果并根据TC KB发布结果

Good luck! 祝好运!

Thinking outside the box you could have an overall build which doesn't really do anything (or use one of your test build configs as your 'master'), with snapshot dependencies on each of your split test builds. 在盒子外面思考你可以有一个整体构建,它实际上没有做任何事情(或者使用你的一个测试构建配置作为你的'主'),在每个拆分测试构建上都有快照依赖。 That way if any of them fail, the 'master' will fail because one the dependent build failed. 这样,如果其中任何一个失败,'master'将失败,因为依赖构建失败。

TW-9990 looks to be concerned with build triggering rather than dependencies. TW-9990看起来与构建触发而不是依赖关系有关。

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

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