GitSCM reference repository - how to verify it is working?

10 views
Skip to first unread message

Luke Lussenden

unread,
Oct 4, 2017, 1:28:43 PM10/4/17
to Jenkins Users
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!


Mark Waite

unread,
Oct 4, 2017, 1:39:03 PM10/4/17
to Jenkins Users
If you're willing to experiment, a change was recently merged to the git-client-plugin which prints a message giving the path to the reference repo.  You can download the unreleased build from https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fgit-client-plugin/detail/master/148/artifacts .  The artifact you need is git-client-plugin.hpi  Upload it to your Jenkins instance and restart Jenkins, and reference repositories will be noted in the console log.

Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/c488b9a8-7a9e-4575-b139-4f5f7ba894dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages