How can I speed up our TeamCity builds?
Asked Answered
D

1

6

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.

Dualpurpose answered 14/3, 2011 at 9:20 Comment(2)
Anyone recommend some good articles or books on source control best practices, CI and solution structure best practices?Dualpurpose
Martin Fowler ftw: martinfowler.com/articles/continuousIntegration.htmlJonme
D
2
  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?

Dramatization answered 14/3, 2011 at 10:4 Comment(2)
Hi James - thanks for your reply. Just to clarify, what do you mean by sync time? To do a full clean checkout with SVN, or just to update? A full checkout takes ages as the repo has grown to over 1GB. Updates vary depending on what's changed. I think our SVN server isn't that speedy, but like you say 10 minutes is still too long to wait really.Dualpurpose
I meant the time to get a whole new copy of your codebase. I think you need to sort that depo out. 10 minutes is ages for a clean copy.Dramatization

© 2022 - 2024 — McMap. All rights reserved.