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

Configure sparse checkouts separately for Jenkinsfile run and "checkout scm" step

XMLWordPrintable

      Hi!

      We would like to propose an option to configure sparse checkout paths separately for

      • the initial checkout on the master node, when (often) only the Jenkinsfile is wanted
      • the "checkout scm" step

      Or at least, an option to disable sparse checkouts for "checkout scm" while still performing them when the Master node just needs the Jenkinsfile.

      We have a large git repository with many files, and the runs benefit a lot from setting "Sparse Checkout paths" to just "Jenkinsfile", as this both conserves space and time.

      But then "checkout scm" will also just check out the Jenkinsfile. Our current ugly workaround is putting this code in the Jenkinsfile:

      checkout scm
      sh 'git config core.sparsecheckout false'
      sh 'git checkout --ignore-skip-worktree-bits – .'

      Thank you for a very useful plugin!

            Unassigned Unassigned
            stbartels Stephan Bartels
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: