I'm not seeing any clear indication that the reference repository I am providing is being utilized. I don't see the "--reference" argument in any of the Git commands that are printed to the console and I am not seeing the cache boost I would expect.
I want to use a reference repository because occasionally our checkouts are getting throttled to kb/sec speeds and timing out. From what I can see, it still looks like everything is copied from the remote repository.
I have the reference directory withing the workspace as an area to be preserved between builds
// cache location
dir("reference"){
git: url: ssh://remote.location.com/repo.git, credentialsId: xyz
}
// build location, wiped clean each build
dir("build_space"){
deleteDir()
checkout([$class: 'GitSCM',
branches: [[name: 'MyCurrentBranch']],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'CloneOption', reference: "${WORKSPACE}/reference"
]
],
submoduleCfg: [],
userRemoteConfigs: [[ credentialsId: 'xyz
', url: 'ssh://remote.location.com/repo.git
' ]]
])
}
The only indication at all that what I'm passing in as a reference is being used is if I point the reference to an existing directory that does not contain a git repo - then I will get a warning in the console output.
Any input - including alternate strategies for caching - would be appreciated.
Thanks!