We have a large SVN repository and I would like to do a sparse checkout on Jenkins. I do understand the concept of sparse checkouts and having it locally I can get things to work as I would like to have it. Doing things on Jenkins however and running it repeatedly I can't get to work.
I have a repo structure as follows
trunk\file.txt
trunk\FolderA
trunk\FolderB
trunk\FolderC
trunk\FolderD
I would like to checkout and update
trunk\file.txt
trunk\FolderA
trunk\FolderB
but NOT
trunk\FolderC
trunk\FolderD
My pipeline code is as follows
checkout([$class: 'SubversionSCM',
additionalCredentials: [[credentialsId: strCredentialsId, realm: strRealm]],
excludedCommitMessages: '',
excludedRegions: '',
excludedRevprop: '',
excludedUsers: '', filterChangelog: false,
ignoreDirPropChanges: false,
includedRegions: '',
locations: [
[
remote: "${strRepoPath}/trunk",
local: "${softwarePath}",
depthOption: 'unknown',
credentialsId: strCredentialsId,
cancelProcessOnExternalsFail: true,
ignoreExternalsOption: false
],
[
remote: "${strRepoPath}/trunk/FolderA",
local: "${softwarePath}/FolderA",
depthOption: 'infinity',
credentialsId: strCredentialsId,
cancelProcessOnExternalsFail: true,
ignoreExternalsOption: false
],
[
remote: "${strRepoPath}/trunk/FolderB",
local: "${softwarePath}/FolderB",
depthOption: 'infinity',
credentialsId: strCredentialsId,
cancelProcessOnExternalsFail: true,
ignoreExternalsOption: false
]
],
quietOperation: false,
workspaceUpdater: [$class: 'UpdateWithCleanUpdater']])
Whenever I run this code the first time, everything looks as expected. However, when Jenkins runs it the following times, the UpdateWithCleanUpdater causes that FolderA and FolderB get first deleted and then checked out again. The result is still correct, however, it takes much longer that I would like it to take and longer than necessary.
I would like to keep the UpdateWithCleanUpdater because I want Jenkins to clean up files generated in the previous run.
Is there any solution to this using the Jenkins SVN plugin? How would I do this "manually", i.e. do a checkout the first time, clean up and only update the following times, and still do automatic Jenkins runs based on change detection on the SVN repo?
Thanks in advance!