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

Git clean() results in clean after, not before

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • job-dsl-plugin
    • None
    • Jenkins ver. 1.646
      Job DSL 1.43
      hudson.plugins.git.GitSCM git@2.4.2

      The documentation on the API Viewer specifies that:

      clean(boolean clean = true)
      Clean up the workspace before every checkout by deleting all untracked files and directories, including those which are specified in .gitignore. Defaults to false.
      

      https://jenkinsci.github.io/job-dsl-plugin/#method/javaposse.jobdsl.dsl.helpers.scm.GitContext.clean

      The result of using clean() is that in the Job configuration, "Clean after checkout" is selected, instead of "before"

      Current outcome:
      clean() --> <clean>true</clean>

      Desired outcome (after manually adding the Clean Before option)
      clean() -->

      <extensions>
        <hudson.plugins.git.extensions.impl.CleanBeforeCheckout/>
      </extensions>
      

      If I however try to add the Clean after checkout manually, the generated xml is the following:

          <extensions>
            <hudson.plugins.git.extensions.impl.CleanCheckout/>
          </extensions>
      

            daspilker Daniel Spilker
            carroarmato0 Christophe Vanlancker
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: