Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-58049

GIT SparseCheckout for multiple clones

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • git-plugin
    • None

      Hi,

      While trying to use sparseCheckout option under jenkins build step or in pipeline script. i am unable to use it for multiple directories checkout. In both instances the path mentioned at the last checks out ignoring the earlier ones. 

      This is the code i am using 

      checkout(
       [
       $class: 'GitSCM', 
       branches: [[name: '*/master']], 
       doGenerateSubmoduleConfigurations: false,
       extensions: [
       [$class: 'SparseCheckoutPaths', sparseCheckoutPaths: [[path: 'TIA-Profiles/*'], [path: '${TARGET_ENVIRONMENT}/*']]]
       ], 
       submoduleCfg: [], 
       userRemoteConfigs: [
       [
       credentialsId: '***********',
       url: 'ssh://git@bitbucket.internal.fbd.ie:7999/rem/properties.git'
       ]]])
      

       

      It ignores the first path  [path: 'TIA-Profiles/*'] and only checks-out path: '${TARGET_ENVIRONMENT}/*']

      Out Repo contitutes of multiple directories and properties files and we don't want to checkout all of it in workspace due security and space constraints. Had tried multiple different ways of doing it but does not works. 

      Kindly suggest.

      Thanks,

       

       

            Unassigned Unassigned
            godarak Khushboo Godara
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: