GitSCM reference repository - how to verify it is working?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

GitSCM reference repository - how to verify it is working?

Luke Lussenden
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!


--
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 [hidden email].
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 | Threaded
Open this post in threaded view
|

Re: GitSCM reference repository - how to verify it is working?

Mark Waite-2
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

On Wed, Oct 4, 2017 at 11:28 AM Luke Lussenden <[hidden email]> wrote:
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!


--
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 [hidden email].
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.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtFkaL8HQVh1FWecygsHBXSQFYNkdzoMCUL%3DR0G%2BTRdeoQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.