Faster way to clean working directory before build

I'm trying to migrate my teams builds from CC.Net to TeamCity.  In order to take advantage of TeamCity's better parallelism, I've broken our build up into multiple configurations, for things like utility libraries, services, GUI, installer, and tests.  Each of these obviously has a separate working copy.

The problem is our SVN-based source tree is very large (it can take 30 minutes just to get the source tree), so a naive clean and checkout solution won't work.  With CC.net I had a nant task that would first do an svn revert, then delete all files not under source control (thus cleaning out things like .obj files), and finally did an update.  It was a fast way to get a clean working directory.

TeamCity doesn't seem to be able to do that.  I've configured the working directory to checkout Automatically on Agent, and checked Clean all files before build.  From the build log, I can see it spent 20 minutes just updating the source code (this is on top of a fairly log running build).  This is compared to 38 seconds with the Clean option turned off.

Is there any way to make TeamCity do a more intelligent clean like I did with CC.net?  I could always use the same nant task and make it part of the build, but I was hoping TeamCity would have implemented this seemingly vital feature.

Thanks in advance

5 comments
Comment actions Permalink

Ability to do 'svn revert' before the build was added in TeamCity 5.0. It seems that right now you will have to use your nant task.

0
Comment actions Permalink

Hello Adam,

  Clean working directory option enforces clean checkout, i.e. removal all old sources and fresh checkout.
  Usually we use TeamCity without this option, in this case svn update is used to update sources. If a conflict or locally modified file is detected during update, TeamCity runs svn revert after update. The option added in 5.0 enforces svn revert before the update. But TeamCity doesn't cleanup old files remained after the previous build. But, there is a plugin, which does this.

  Hope this helps,
  KIR

0
Comment actions Permalink

Thanks Kirill.  

I tried using my nant task to do the revert and clean, but this creates another problem, since the revert runs after the artifacts from any dependent builds are processed, it ends up cleaning up the artifacts copied in by TeamCity.

Can you tell me more about this Swabra plugin?  I can't tell from its description if it does what I need or not.

Adam

0
Comment actions Permalink

Hello Adam,

   I'd appreciate if you clarify which sentences are formulated badly and unclear in the plugin description. This would allow us to make it more clear.

   If you have specific questions, please ask. We'll try to answer them and reflect answers on the plugin page.

  The more or less exact operations performed by plugin are described under "Plugin usage" heading.

   Thanks,
   KIR

0
Comment actions Permalink

The initial description of the plugin is right-on, but the bit about taking a snapshot of the working directory and detecting changes confused me, because it made it sound to me like the purpose of the plugin was to show you what files changed during a build.

I've since downloaded and installed the plugin, and it's exactly what I needed.  Maybe a screenshot of the Swabra section of the Nant Runner UI would go a long way towards clarifying things.

Anyway, thanks for the pointer; the plugin solved my problem.

0

Please sign in to leave a comment.