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

Sparse checkout definition change not applied to workspace

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • None

      Hi, team,

      When we use the ‘Sparse Checkout paths’ of Additional Behaviours, we meet one question.

      Environment Descriptions:
      Jenkins running type: Docker
      Jenkins Job type: Pipeline
      Sparse Checkout Path: test
      Script Path: test/Jenkinsfile

      Question Descriptions:
      Under test/, we had two files, one is Jenkinsfile, the other one is one shell script which will be called by Jenkinsfile.

      After configuring the git source, and specified the Sparse checkout paths by adding an additional behaviour and Script Path as above,
      the first build can be run successfully.

      And then, we change the Code Structure to Git server side.
      Moved Jenkinsfile and Shell script to test/test1/.
      And indisde Jenkins job, changed Sparse Checkout path from test to test/test1, changed Script Path from test/Jenkinsfile to test/test1/Jenkinsfile.

      And executed the second build, Console output of Jenkins threw one error:
      stderr: error: Entry ‘test/Jenkinsfile’ not uptodate. Cannot update sparse checkout.

      After investigation, we found that the Jenkins workspace haven’t be updated to the new code structure, still the old one.
      If we clean the workspace manually, the build can be run successfully.

      How to implement this in Jenkins automatically?

      Please help to investigate this issue.

      Thanks in advance. 

            Unassigned Unassigned
            yunquaner Wang Yuan Yuan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: