Is there a way to have a permanent checkout directory?
In order to speed up builds, we'd like for the checkout process to only involve grabbing what is needed - the stuff that is changed - and applying it into creating the build. As of now, the checkout process involves a deletion and a full redo of the checkout directory in the agent work folder. We'd like TeamCity to preserve the contents of the checkout directory so that it can checkout only what it needs to. Is there a way to prevent it from deleting the checkout directory after each build?
We are using server-side checkout. As far as we are aware, it is not performing a clean checkout; according to the log, it creates the incremental patch like normal. Here is a snippet from the log.
[16:26:31]The build is removed from the queue to be prepared for the start
[16:26:31]Collecting changes in 1 VCS root
[16:26:31][Collecting changes in 1 VCS root] VCS Root details
[16:26:31][Collecting changes in 1 VCS root] Detecting changes in VCS root 'Visual Subversion' (used in 'Authorization Service Release 1', 'Billing Center' and 10 other configurations)
[16:26:31][Collecting changes in 1 VCS root] Will collect changes for 'Visual Subversion' starting from revision 25677_2019/08/13 16:25:31 -0400
[16:26:31][Collecting changes in 1 VCS root] VCS revisions for 'Visual Subversion' - 25677_2019/08/13 16:25:31 -0400..25677_2019/08/13 16:26:31 -0400
[16:26:31][Collecting changes in 1 VCS root] Processing combined checkout rule for 'Visual Subversion' with 17 include rules
[16:26:31][Collecting changes in 1 VCS root] Done collecting changes for 'Visual Subversion': 0 changes collected 0 changes persisted, total time: 316ms, persisting time: < 1ms
[16:26:31][Collecting changes in 1 VCS root] Compute revision for 'Visual Subversion'
[16:26:31]Starting the build on the agent "TeamCityBuilder.Pool1"
[16:26:32]Updating tools for build
[16:26:32][Updating tools for build] Tools are not required for the build
[16:26:32]Clearing temporary directory: D:\TB.P1\temp\buildTmp
[16:26:32]Publishing internal artifacts
[16:26:32][Publishing internal artifacts] Publishing 1 file using [WebPublisher]
[16:26:32]Transferring cached clean patch for VCS root: Visual Subversion
[16:26:32]Will perform clean checkout. Reason: Checkout directory is empty or doesn't exist
[16:26:32]Checkout directory: D:\TB.P1\work\410c6ab066593399
[16:26:32]Updating sources: server side checkout (3m:49s)
[16:27:24][Updating sources] Building incremental patch over the cached patch
[16:27:24][Updating sources] Repository sources transferred (1.62 GB)
[16:27:24][Updating sources] Average transfer speed: 31.83 MB per second
[16:27:24][Updating sources] Removing D:\TB.P1\work\410c6ab066593399
[16:27:24][Updating sources] Updating D:\TB.P1\work\410c6ab066593399\Guidewire\Install\GW\808\PolicyCenter.zip
[16:27:26][Updating sources] Updating D:\TB.P1\work\410c6ab066593399\Guidewire\Install\Scripts.zip
[16:27:26][Updating sources] Updating D:\TB.P1\work\410c6ab066593399\Guidewire\Install\build.xml
[16:27:26][Updating sources] Updating D:\TB.P1\work\410c6ab066593399\Guidewire\Install\gwbase.properties
[16:27:26][Updating sources] Updating D:\TB.P1\work\410c6ab066593399\Guidewire\Java
[16:27:26][Updating sources] Updating D:\TB.P1\work\410c6ab066593399\Guidewire\PolicyCenter\modules
Reading the documentation, it was my understanding that the checkout directory remains there and is only updated with patches unless a clean checkout is launched. The log doesn't mention a clean checkout, however, so I'm wondering why the checkout directory is removed anyway.
Thanks,
Josh
Please sign in to leave a comment.
Hi,
Under normal circumstances, teamcity does not perform a clean checkout (the term we use for forcefully removing the previous content and downloading everything again), unless you enable clean checkout on the VCS Settings.
I'd recommend checking the teamcity-agent.log comparing the timestamps at build start to see whether there is anything in particular which might be indicative of the folders being emptied or needing cleaning.
Which version of teamcity are you using?