如何加快 TeamCity 构建速度?

发布于 2024-10-21 16:36:42 字数 532 浏览 1 评论 0原文

近几个月来,我们的存储库规模已大幅增长,而 TeamCity 构建现在变得非常缓慢。

其中很大一部分来自安装文件和其他非代码、非必要(无论如何构建)的东西,人们已经签入了 SVN。

我们只运行基本的免费版本并有 3 个代理。我们的 VCS 结帐模式是“自动在服务器上”。这两个解决方案文件都是 C# 的,我们使用的是 MSBuild 脚本。

我喜欢构建配置中的签出规则部分,但已读到它不起作用,因为它会获取所有代码,然后应用规则,如果您问我,这会击败该对象。

现在,构建需要大约 1 小时,但如果我能让 TeamCity 获取它所需的代码,而不需要其他任何东西,那么我认为我可以将其缩短到 10 分钟或更短。

我发现了一些排除文件和文件的文章使用 MSBuild 的文件夹,但我在构建脚本中找不到任何有关从 SVN 获取的内容,我认为 TeamCity 可以做到这一点。

任何人都可以建议我们可以进行任何更改,或者关于使用 TeamCity 和 MSBuild 从头开始​​构建构建的好文章,让我可以选择从 SVN 获取什么内容?

谢谢。

Our repository has grown in size quite a bit in recent months and TeamCity builds have now become seriously slow.

A lot of the bulk comes from installation files and other non-code, non-essential (for build anyhow) things that people have checked into SVN.

We just run the basic free version and have 3 agents. Our VCS checkout mode is 'Automatically on server'. The 2 solution files are both C# and we're using an MSBuild script.

I've fond the checkout rules section in the build configuration, but have read that it won't work because it fetches all the code and THEN applies the rules, which defeats the object if you ask me.

A build now takes about 1hr, but if I could just get TeamCity to fetch the code it needs and nothing else then I reckon I could get it down to 10 minutes or less.

I have found a few articles that exclude files & folders using MSBuild, but I can't find anything in our build scripts about fetching from SVN and I think TeamCity does it.

Can anyone suggest any changes we can make, or good articles on putting a build together from scratch using TeamCity and MSBuild that would allow me to pick and choose what to fetch from SVN?

Thanks.

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

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

发布评论

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

评论(1

桃扇骨 2024-10-28 16:36:42
  1. 只构建变化的部分。
  2. CI 构建不需要完成发布构建所做的所有事情。 CI 所需要做的就是编译并进行一些验证。
  3. 解决方案,有时开发人员将负载放入任何单个 sln 中。如果您在一个 sln 中有大量服务并且每次只进行一项更改就会构建?
    因此,将它们分开 - 每个输出一个 sln(我的意思是 exe 或服务或其他任何不是单个 DLL 的东西)
  4. 并行构建。
    每个输出有不同的构建目标(在 TeamCity 中)
  5. 构建到工件,部署工件。这意味着您永远不必等待构建完成才能部署。

十分钟的同步对于 SVN 来说仍然是一个非常长的时间,这确实需要下来,在命令行需要多长时间?
将非构建相关的项目移动到另一个存储库?

有了大型代码库和 svn,请考虑将核心组件构建到 Svn 中签入的二进制文件/引用部分。
这允许您与其他团队共享构建的对象,而不是浪费时间构建他们的代码。

希望有帮助吗?

  1. Build only whats changing.
  2. CI builds don't need to do all what a release build does. All the CI needs to is compile and do some verification.
  3. Solutions, sometime devs put loads into any single sln. If youve got loads of services in one sln and it builds everytime just one changes?
    So split them up - one sln per output (I mean exe or service or whatever not a single DLL)
  4. Parallelise the build.
    Have different build targets for each output (in TeamCity)
  5. Build to artifacts, deploy artifacts. This means that you should never have to wait for a build to finish to deploy.

A ten minute sync is still a really long time for SVN, that's really got to come down, how long does it take at the command line?
Move the non build related items to another repo?

With a large code base and svn consider building core components out to a checked in binaries/references section in Svn.
This allows you to share built objects to other teams rather than wasting time building their code.

Hope that helps?

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