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

Add option to clean workspace before each build

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Major Major
    • core
    • None
    • Platform: All, OS: All

      If this option is selected the workspace will be deleted before each build
      begins so that each build can have a fresh workspace. This will be off by default.

          [JENKINS-3966] Add option to clean workspace before each build

          kaxelson added a comment -

          starting work on this

          kaxelson added a comment - starting work on this

          Code changed in hudson
          User: : kaxelson
          Path:
          trunk/hudson/main/core/src/main/java/hudson/model/AbstractBuild.java
          trunk/hudson/main/core/src/main/java/hudson/model/AbstractProject.java
          trunk/hudson/main/core/src/main/resources/hudson/model/AbstractItem/configure-common.jelly
          trunk/hudson/main/core/src/main/resources/lib/hudson/project/config-cleanWorkspace.jelly
          trunk/hudson/main/war/resources/help/project-config/cleanWorkspace.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=19373
          Log:
          [FIXED JENKINS-3966] added option to clean workspace before each build as part of advanced project configuration

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : kaxelson Path: trunk/hudson/main/core/src/main/java/hudson/model/AbstractBuild.java trunk/hudson/main/core/src/main/java/hudson/model/AbstractProject.java trunk/hudson/main/core/src/main/resources/hudson/model/AbstractItem/configure-common.jelly trunk/hudson/main/core/src/main/resources/lib/hudson/project/config-cleanWorkspace.jelly trunk/hudson/main/war/resources/help/project-config/cleanWorkspace.html http://fisheye4.cenqua.com/changelog/hudson/?cs=19373 Log: [FIXED JENKINS-3966] added option to clean workspace before each build as part of advanced project configuration

          Code changed in hudson
          User: : kaxelson
          Path:
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=19374
          Log:
          JENKINS-3966: adding changelog message

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : kaxelson Path: trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=19374 Log: JENKINS-3966 : adding changelog message

          Rolled back from 1.315 release in rev.19544. See
          http://www.nabble.com/attention-all-subversion-users-td24335693.html for the
          discussion.

          Kohsuke Kawaguchi added a comment - Rolled back from 1.315 release in rev.19544. See http://www.nabble.com/attention-all-subversion-users-td24335693.html for the discussion.

          Jesse Glick added a comment -

          Note that the Mercurial plugin already has an option to delete all nonversioned
          files from the workspace before starting. (The .hg/ subdirectory is excluded as
          is usual.) I think there is a similar issue open for Subversion. This is more
          efficient than deleting everything in the workspace, but may not be applicable
          for all situations.

          Jesse Glick added a comment - Note that the Mercurial plugin already has an option to delete all nonversioned files from the workspace before starting. (The .hg/ subdirectory is excluded as is usual.) I think there is a similar issue open for Subversion. This is more efficient than deleting everything in the workspace, but may not be applicable for all situations.

          dma_k added a comment -

          The option to remove all workspace is important to make maven release plugin to
          work correctly for the projects, that generate sources e.g. with JAXB. In my
          case I commit JAXB sources from Windows environment, which after being
          re-generated have different EOF and SVN senses this as uncommitted change, which
          in its turn blocks the release.
          If the fix is ready, what is the target milestone for this fix?

          dma_k added a comment - The option to remove all workspace is important to make maven release plugin to work correctly for the projects, that generate sources e.g. with JAXB. In my case I commit JAXB sources from Windows environment, which after being re-generated have different EOF and SVN senses this as uncommitted change, which in its turn blocks the release. If the fix is ready, what is the target milestone for this fix?

          smr99 added a comment -

          What is the status of this? I read through the referenced email thread (now at http://markmail.org/message/mcgftdni6cvpca7v) which seemed to end with agreement on the feature but issues with backwards compatibility.

          smr99 added a comment - What is the status of this? I read through the referenced email thread (now at http://markmail.org/message/mcgftdni6cvpca7v ) which seemed to end with agreement on the feature but issues with backwards compatibility.

          jhoomsharabi added a comment - - edited

          Does this functionality anytime implemented, as I see this issue is being reopened.

          jhoomsharabi added a comment - - edited Does this functionality anytime implemented, as I see this issue is being reopened.

          Rob Petti added a comment -

          Can't this option just call the same function as the "Wipe Out Workspace" feature? If the SCM plugin supports it, then everything will be fine. If it doesn't then it simply won't delete the workspace.

          Rob Petti added a comment - Can't this option just call the same function as the "Wipe Out Workspace" feature? If the SCM plugin supports it, then everything will be fine. If it doesn't then it simply won't delete the workspace.

          bvakili added a comment -

          I like Kohsuke's proposal of providing an 'extension point in core to abstract away various "clean" logic'.
          http://n4.nabble.com/attention-all-subversion-users-tp393646p393656.html

          bvakili added a comment - I like Kohsuke's proposal of providing an 'extension point in core to abstract away various "clean" logic'. http://n4.nabble.com/attention-all-subversion-users-tp393646p393656.html

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          core/src/main/java/hudson/scm/NoCleaner.java
          core/src/main/java/hudson/scm/RmRfCleaner.java
          core/src/main/java/hudson/scm/WorkspaceCleaner.java
          core/src/main/java/hudson/scm/WorkspaceCleanerDescriptor.java
          core/src/main/resources/hudson/scm/SCM/configure-workspaceCleaner.jellytag
          core/src/main/resources/hudson/scm/WorkspaceCleaner/config.jelly
          http://jenkins-ci.org/commit/jenkins/07c6c4f1dc9c41a2cf8fc1ee9a8935310ca9afb0
          Log:
          JENKINS-3966 added a new extension point for workspace cleaner

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: core/src/main/java/hudson/scm/NoCleaner.java core/src/main/java/hudson/scm/RmRfCleaner.java core/src/main/java/hudson/scm/WorkspaceCleaner.java core/src/main/java/hudson/scm/WorkspaceCleanerDescriptor.java core/src/main/resources/hudson/scm/SCM/configure-workspaceCleaner.jellytag core/src/main/resources/hudson/scm/WorkspaceCleaner/config.jelly http://jenkins-ci.org/commit/jenkins/07c6c4f1dc9c41a2cf8fc1ee9a8935310ca9afb0 Log: JENKINS-3966 added a new extension point for workspace cleaner

          jlpinardon added a comment -

          It would be a user friendly enhancement to add the ability to select a list (possibly based on pattern) of directory to wipe out (or not).

          jlpinardon added a comment - It would be a user friendly enhancement to add the ability to select a list (possibly based on pattern) of directory to wipe out (or not).

          (I've been wiping out specific directories by adding ant tasks into the my jobs.)

          Hey guys, thanks for enhancing this section of Jenkins. The clean selections in Jenkins 1.414 work great for me: both the delete-workspace and the other varieties of cleaning.

          John Muczynski added a comment - (I've been wiping out specific directories by adding ant tasks into the my jobs.) Hey guys, thanks for enhancing this section of Jenkins. The clean selections in Jenkins 1.414 work great for me: both the delete-workspace and the other varieties of cleaning.

          I think this issue has been addressed by this new-ish plugin https://wiki.jenkins-ci.org/display/JENKINS/Workspace+Cleanup+Plugin

          G. Ann Campbell added a comment - I think this issue has been addressed by this new-ish plugin https://wiki.jenkins-ci.org/display/JENKINS/Workspace+Cleanup+Plugin

          Jesse Glick added a comment -

          Workspace Cleanup Plugin would delete the entire workspace. For most purposes you would rather just delete unversioned files (typically build products), as well as reverting any local modifications to versioned files, since a full checkout/clone/etc. is likely to be a lot more expensive than an incremental update.

          Jesse Glick added a comment - Workspace Cleanup Plugin would delete the entire workspace. For most purposes you would rather just delete unversioned files (typically build products), as well as reverting any local modifications to versioned files, since a full checkout/clone/etc. is likely to be a lot more expensive than an incremental update.

          Jesse Glick added a comment -

          The mentioned plugin should be used; or many SCM plugins now offer the option of deleting unversioned files.

          Jesse Glick added a comment - The mentioned plugin should be used; or many SCM plugins now offer the option of deleting unversioned files.

            kaxelson kaxelson
            kaxelson kaxelson
            Votes:
            19 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated:
              Resolved: