如何加快 TeamCity 构建速度?
近几个月来,我们的存储库规模已大幅增长,而 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,将它们分开 - 每个输出一个 sln(我的意思是 exe 或服务或其他任何不是单个 DLL 的东西)
每个输出有不同的构建目标(在 TeamCity 中)
十分钟的同步对于 SVN 来说仍然是一个非常长的时间,这确实需要下来,在命令行需要多长时间?
将非构建相关的项目移动到另一个存储库?
有了大型代码库和 svn,请考虑将核心组件构建到 Svn 中签入的二进制文件/引用部分。
这允许您与其他团队共享构建的对象,而不是浪费时间构建他们的代码。
希望有帮助吗?
So split them up - one sln per output (I mean exe or service or whatever not a single DLL)
Have different build targets for each output (in TeamCity)
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?