TeamCity - 非常重要的构建顺序,请提出建议

发布于 2024-10-01 06:11:50 字数 722 浏览 3 评论 0原文

我的任务是提高质量并实施 TeamCity 来实现持续集成。我使用 TeamCity 的经验非常有限 - 我自己主要使用 TFS,并且对 CC.NET 有一些经验。

构建过程中应该发生很多事情......实际上构建已经被推送到三种不同的配置中,这些配置将一个接一个地运行。

我的主要问题是,在每一个中,我实际上都需要启动多个跑步者。例如,第一个构建步骤应包括:

  • 生成新的 AssemblyInfo.cs 文件以保持程序集编号一致
  • 实际编译
  • 部分单元测试运行(所有快速运行并检查核心功能的测试)
  • FxCop 运行
  • StyleCop

运行当前版本的 TeamCity 只允许配置一个运行程序……这让我陷入了很多困境。

你会如何处理这个问题?我目前的想法是使用 MsBuild 运行程序来处理所有事情,并基本上启动我自己的基于 MsBuild 的脚本,然后执行所有操作,几乎与 TFS 处理它的方式相同(与我以 cc.net 方式做事的方式相同)使用我自己的 Nant 构建脚本)。

另一个问题是如何呈现统计信息,例如来自不同阶段(构建配置)运行的单元测试的统计信息。我们还有一些需要一些时间才能运行的任务,并希望在第二步或第三步中运行(最新的例如测试数据库生成代码,包括加载基础数据,需要大约 15 分钟以上的时间来运行)。 OTOH,我们真的希望测试结果能以某种方式得到整合。

有人有什么想法吗?

谢谢。

I am tasked to improve quality and implement TeamCity for continuous integration. My experience with TeamCity is very limited - I use mostly TFS myself and have some experience with CC.NET.

A lot should happen within a build process... actually the build is already pushed into three different configurations that will run one after the next.

My main problem is that in each of those I actually would need to start multiple runners. For example, the first build step shall consist of:

  • The generation of new AssemblyInfo.cs files for consistent in assembly numbering
  • The actual compilation
  • A partial unit test run (all tests that run fast and check core functionality)
  • An FxCop run
  • A StyleCop run

The current version of TeamCity only allows to configure one runner ... which leaves me stuck with a lot of things.

How you would approach this? My current idea is going towards using the MsBuild runner for everything and basically start my own MsBuild based script which then does all the things, pretty much the way that TFS handles it (and the same way i did things back in the cc.net way with my own Nant build script).

On a further problem the question is how to present statistical information, for example from unit tests running in different stages (build configurations). We have some further down that take some time to run and want that to run in a 2nd or 3rd step (the latest for example testing database generation code which, including loading base data, takes about 15+ minutes to run). OTOH we would really like test results to be somehow consolidated.

Anyone any ideas?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

策马西风 2024-10-08 06:11:50

TeamCity 6.0 允许单个构建配置执行多个构建步骤。这不是你要找的吗?

TeamCity 6.0 allows multiple build steps for a single build configuration. Isn't it what you're looking for?

私藏温柔 2024-10-08 06:11:50

您需要编写此脚本,至少是其中的一部分。 TeamCity 提供了一些不错的基于 UI 的配置来满足您的某些需求,但不是全部。我的建议是:

创建一个 msbuild 脚本来处理前两个要点:AssemblyInfo 生成和编译。配置 msbuild 运行程序以运行脚本并运行测试。将您的程序集作为工件收集。

为 FxCop 创建第二个构建配置。从第一个构建开始触发它。在第一个构建中给它一个“工件依赖”,这就是它获取 dll 的方式。

对于 StyleCop,TC 不像 FxCop 那样支持开箱即用。手动将其添加到您的 msbuild 脚本中,并让它生成 html 报告(然后 TeamCity 可以显示该报告)。

You'll need to script this out, at least parts of it. TeamCity provides some nice UI based config for some of your needs, but not all. Here's my suggestion:

Create an msbuild script to handle your first two bullet points, AssemblyInfo generation and compilation. Configure the msbuild runner to run your script, and to run your tests. Collect your assemblies as artifacts.

Create a second build configuration for FxCop. Trigger it from the first build. Give it an 'artifact dependency' on the first build, which is how it gets a hold of your dlls.

For StyleCop, TC doesn't support it out of the box like it does FxCop. Add it to your msbuild script manually, and have it produce an html report (which TeamCity can then display).

笨笨の傻瓜 2024-10-08 06:11:50

您需要查看依赖项 TeamCity 中的功能。此功能允许您创建一系列构建配置。换句话说,您需要为每个步骤创建一个构建配置,然后将它们作为依赖项链接起来。
要合并测试结果,请查看工件依赖项。这可能有帮助。

You need to take a look at the Dependencies functionality in the TeamCity. This feature allows you to create a sequence of build configurations. In other words, you need to create a build configuration for each step and then link all them as dependencies.
For consolidating test results please take a loot at the Artifact Dependencies. It might help.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文