Using Sourcegear Vault in TeamCity for Large Repositories

Here was my problem, we currently use 1 repository for all our projects, can be large, up to a few gig of projects.
Now the way the Vault Plugin works, it will transfer the entire repository.. which ends up with errors, either running out of memory or pathtoolong

Here is how I got it working.

1.     First, I would create a shared VCS root to use Vault
2.     On the project, select the VCS root and make sure you select "Do NOT checkout files automatically"
3.     Create a build step, make sure it is the first build step, I suggest creating a batch file since it will contain a password, and have it run the following command.

"C:\Program Files\SourceGear\Vault Client\vault.exe" GET -server serverName -user myUserName -password myPassword -repository "My Repository" $/FolderName -nonworkingfolder ""

Way this works is.. It will detect changes from the VCS root but use the command line to pull them out of the source.

Last thing is..

4.    Create a Build Trigger and add +:FolderName

Only downside is the "Changes" show for everyones checkin but only triggers on changes inside the "FolderName"

Comment actions Permalink


Could you please post a screenshot of VCS root settings, version control settings in a build configuration, and a build log with the errors.


Comment actions Permalink

Here was my build log..

[15:44:49]: Updating sources: server side checkout... (3m:38s)
[15:48:27]: [Updating sources: server side checkout...] Failed  to build patch for build #27 {build id=168}, VCS root: vault:  http://atiweb/VaultService {id=3}, due to error:  System.IO.PathTooLongException: The specified path, file name, or both  are too long.After full qualification, each must be less than 260  characters.
at system.IO.Path.__CreateClass__0x00000000(Unknown Source)
at system.IO.Path.GetFullPath(Unknown Source)
at system.IO.FileInfo.<init>(Unknown Source)
at system.IO.FileInfo.__CreateClass__0x00000005(Unknown Source)
at system.IO.FileInfo.CopyTo(Unknown Source)
at system.IO.File.Copy(Unknown Source)
at VaultClientOperationsLib.ClientInstance.ProcessFile_NonWorkingFolder(Unknown Source)
at VaultClientOperationsLib.ClientInstance.ProcessGetFileRequests(Unknown Source)
at VaultClientOperationsLib.ClientInstance.GetByDisplayVersionToNonWorkingFolder(Unknown Source)
at VaultClientOperationsLib.ClientInstance.GetByDisplayVersionToNonWorkingFolder(Unknown Source)
at VaultClientIntegrationLib.GetOperations.performGetVersion(GetOperations.cs:570)
at VaultClientIntegrationLib.GetOperations.ProcessCommandGetVersionToLocationOutsideWorkingFolder(GetOperations.cs:508)
at jetbrains.buildServer.buildTriggers.vcs.vault.VaultConnection.getObjectToDirFromVcs(
at jetbrains.buildServer.buildTriggers.vcs.vault.VaultConnection.getFolderFromVcs(
at jetbrains.buildServer.buildTriggers.vcs.vault.VaultConnection.getObjectItself(
at jetbrains.buildServer.buildTriggers.vcs.vault.VaultConnection.getRepoObject(
at jetbrains.buildServer.buildTriggers.vcs.vault.VaultConnection.getObject(
at jetbrains.buildServer.buildTriggers.vcs.vault.VaultPatchBuilder$1.process(
at jetbrains.buildServer.buildTriggers.vcs.vault.VaultConnection.doInConnection(
at jetbrains.buildServer.buildTriggers.vcs.vault.VaultPatchBuilder.buildCleanPatch(
at jetbrains.buildServer.buildTriggers.vcs.vault.VaultPatchBuilder.buildPatch(
at jetbrains.buildServer.serverSide.impl.projectSources.BuildPatchUtil$1.buildPatch(
at jetbrains.buildServer.vcs.VcsSupportUtil.buildPatch(
at jetbrains.buildServer.serverSide.impl.projectSources.BuildPatchUtil.buildPatch(
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildCleanPatch(
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.makePatch(
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatchForRoot(
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatch(
at jetbrains.buildServer.serverSide.impl.BuildTypeImpl.buildPatch(
at jetbrains.buildServer.serverSide.impl.BuildTypeImpl$$FastClassByCGLIB$$a84db719.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
at  jetbrains.buildServer.serverSide.impl.auth.TeamCityMethodSecurityInterceptor.invoke(
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
at org.springframework.aop.framework.Cglib2AopProxy$FixedChainStaticTargetInterceptor.intercept(
at jetbrains.buildServer.serverSide.impl.BuildTypeImpl$$EnhancerByCGLIB$$ba0e9396.buildPatch(<generated>)
at jetbrains.buildServer.serverSide.impl.BuildStarter$
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$ Source)
at Source)

[15:48:27]: Will repeat attempt when server will be available, number of attempts left: 2
[15:49:03]: Will repeat attempt when server will be available, number of attempts left: 1
[15:49:14]: Updating sources: server side checkout...
[15:49:14]: [Updating sources: server side checkout...] Patch interrupted: Patch process is interrupted
[15:49:14]: Build cancelled

I eventually cancelled it since it was just erroring everytime, major problem is.. if it did pull the repository, it would be HUGE since there are a ton of projects in it, instead of my build taking a few mins, it would most like take at least 20-30mins im guessing, that would be pretty unnessassary since I only need 1 folder from my repository

Comment actions Permalink


Did you try using checkout rules like +:FolderName in the build configuration?

Comment actions Permalink

Wow, thank you Victory.. I actually didn't even know about Checkout rules, kinda of hidden...

Added it and worked.. HUGE thanks


Please sign in to leave a comment.