Clean checkout on agents using automatic server-side checkout, but preserving server cache - possible?

Is it possible to do a clean checkout on an agent by removing the agent's checkout directory and transferring the pristine state of the repository from the server's cache, without making the server itself do a full sync from the VCS again?

This is exactly the way I would have expected clean checkouts to work. Why would the server's untouched patches downloaded from VCS ever need to be cleaned? Surely it's only on the agents where modifications may have taken place?

As it is, I don't see any way to reliably get back to a pristine state on agents without incurring a lot of network traffic!

For reference, I'm using both SVN and git VCS.

Thanks,
Ben

7 comments
Comment actions Permalink

Hello,

Server-side checkout should work as you expected. VCS full patch caches are not reset when clean checkout is performed, only the content of the checkout directory on agent should be deleted. The caches are reset during the cleanup time.
What TeamCity version do you use? Please attach logs/screenshots illustrating the problem.

0
Comment actions Permalink

I'm using Team City 9.1.3.

Thanks - it looks like it's the cleanup that's removing patches as you say. Is there some way to make VCS patch cleanup less frequent than other parts of cleanup? With cleanup being done every day, the server will have to do a full sync once a day, which is completely unnecessary. I'd still like to clean up artifacts and so on every night so would rather not just drop the cleanup frequency right down.

Also, for when cleanup does need to be done of server VCS caches, is there a way to schedule a task to build a patch after the cleanup so it's ready for when the first build needs it?

0
Comment actions Permalink

Hi Ben,

Unfortunately it's not possible to disable clean-up of VCS patch caches. You can try to use agent-side checkout. Also as workaround you can create a fake build configuration with the same VCS root attached and the same checkout rules, which starts when cleanup finished.

0
Comment actions Permalink

Great, thanks. Shame it's not supported, but you're right, I should be able to schedule a build that will finish before anyone arrives in the morning, meaning all subsequent builds will have short syncs. Shame we still have to use that much bandwidth every day!

0
Comment actions Permalink

Why don't you want to switch to agent-side checkout?

0
Comment actions Permalink

I'd like to use the server-side caching of VCS patches to avoid too many long syncs. Some configurations perform clean builds which would need to do a full sync using agent-side checkout. I tried using SWABRA to clean (which should work nicely alongside SVN's 'revert before build') but I found it to be quite buggy.

I'm also trying out using git-svn to maintain a pristine git mirror on the server to read from, which will allow very fast full syncs with only local network traffic.

0
Comment actions Permalink

Thank you for details. I see your point.
It would be great if you share with us the problems that you faced while using Swabra build feature. You can post it as a new thread in forum.

0

Please sign in to leave a comment.