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 "%system.teamcity.build.checkoutDir%"

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"

4 comments
Comment actions Permalink

Hi

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

Thanks
Michael

0
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(VaultConnection.java:281)
at jetbrains.buildServer.buildTriggers.vcs.vault.VaultConnection.getFolderFromVcs(VaultConnection.java:269)
at jetbrains.buildServer.buildTriggers.vcs.vault.VaultConnection.getObjectItself(VaultConnection.java:215)
at jetbrains.buildServer.buildTriggers.vcs.vault.VaultConnection.getRepoObject(VaultConnection.java:196)
at jetbrains.buildServer.buildTriggers.vcs.vault.VaultConnection.getObject(VaultConnection.java:177)
at jetbrains.buildServer.buildTriggers.vcs.vault.VaultPatchBuilder$1.process(VaultPatchBuilder.java:74)
at jetbrains.buildServer.buildTriggers.vcs.vault.VaultConnection.doInConnection(VaultConnection.java:62)
at jetbrains.buildServer.buildTriggers.vcs.vault.VaultPatchBuilder.buildCleanPatch(VaultPatchBuilder.java:72)
at jetbrains.buildServer.buildTriggers.vcs.vault.VaultPatchBuilder.buildPatch(VaultPatchBuilder.java:61)
at jetbrains.buildServer.serverSide.impl.projectSources.BuildPatchUtil$1.buildPatch(BuildPatchUtil.java)
at jetbrains.buildServer.vcs.VcsSupportUtil.buildPatch(VcsSupportUtil.java:93)
at jetbrains.buildServer.serverSide.impl.projectSources.BuildPatchUtil.buildPatch(BuildPatchUtil.java:5)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildCleanPatch(PatchComposer.java:13)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.makePatch(PatchComposer.java:62)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatchForRoot(PatchComposer.java:68)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatch(PatchComposer.java:1)
at jetbrains.buildServer.serverSide.impl.BuildTypeImpl.buildPatch(BuildTypeImpl.java:315)
at jetbrains.buildServer.serverSide.impl.BuildTypeImpl$$FastClassByCGLIB$$a84db719.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at  jetbrains.buildServer.serverSide.impl.auth.TeamCityMethodSecurityInterceptor.invoke(TeamCityMethodSecurityInterceptor.java:9)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.Cglib2AopProxy$FixedChainStaticTargetInterceptor.intercept(Cglib2AopProxy.java:582)
at jetbrains.buildServer.serverSide.impl.BuildTypeImpl$$EnhancerByCGLIB$$ba0e9396.buildPatch(<generated>)
at jetbrains.buildServer.serverSide.impl.BuildStarter$2.call(BuildStarter.java:14)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown 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


Attachment(s):
vault.png
0
Comment actions Permalink

Lee,

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

0
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

0

Please sign in to leave a comment.