• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • release-plugin
    • None
    • Platform: All, OS: All

      Releasing from a clean view prevents any potential left over files from getting
      in to the release.

          [JENKINS-3934] Clean workspace prior to release build

          michaelhaug added a comment -

          Created an attachment (id=924)
          Custom FileSystemProvisioner to delete workspace if release build is triggered

          michaelhaug added a comment - Created an attachment (id=924) Custom FileSystemProvisioner to delete workspace if release build is triggered

          michaelhaug added a comment -

          Created an attachment (id=925)
          Patched class hudson.model.node to use custom FileSystemProvisioner instead of default one

          michaelhaug added a comment - Created an attachment (id=925) Patched class hudson.model.node to use custom FileSystemProvisioner instead of default one

          michaelhaug added a comment -

          We have solved this issue by using a custom FileSystemProvisioner (see
          attachment). Unfortunately this requires the following change in the hudson
          core class hudson.model.Node:

          public FileSystemProvisioner getFileSystemProvisioner()

          { // TODO: make this configurable or auto-detectable or something else // return FileSystemProvisioner.DEFAULT; // use custom FileSystemProvisioner to delete workspace if release build is triggered. return CustomFileSystemProvisioner.RELEASE; }

          michaelhaug added a comment - We have solved this issue by using a custom FileSystemProvisioner (see attachment). Unfortunately this requires the following change in the hudson core class hudson.model.Node: public FileSystemProvisioner getFileSystemProvisioner() { // TODO: make this configurable or auto-detectable or something else // return FileSystemProvisioner.DEFAULT; // use custom FileSystemProvisioner to delete workspace if release build is triggered. return CustomFileSystemProvisioner.RELEASE; }

          nellyt added a comment -

          https://issues.jenkins-ci.org/browse/JENKINS-3966
          appears to of added a "Delete workspace before build starts"

          I do not want to do this on every build only Release builds.

          If I attempt to clean the workspace using this plugin step "Before release build"
          then it is executed after the checkout/update which is obviously of no use.

          nellyt added a comment - https://issues.jenkins-ci.org/browse/JENKINS-3966 appears to of added a "Delete workspace before build starts" I do not want to do this on every build only Release builds. If I attempt to clean the workspace using this plugin step "Before release build" then it is executed after the checkout/update which is obviously of no use.

          Oliver Giles added a comment -

          The BuildWrapper class provides a preCheckout method, would this not be the ideal place to implement this functionality in the release plugin?

          I'm not a seasoned jenkins developer but the attached patch seems to Work For Me. I would appreciate it if a contributor to this plugin would review it.

          Oliver Giles added a comment - The BuildWrapper class provides a preCheckout method, would this not be the ideal place to implement this functionality in the release plugin? I'm not a seasoned jenkins developer but the attached patch seems to Work For Me. I would appreciate it if a contributor to this plugin would review it.

            petehayes Peter Hayes
            petehayes Peter Hayes
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: