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

Clean workspace prior to release build

    XMLWordPrintable

Details

    • Improvement
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • release-plugin
    • None
    • Platform: All, OS: All

    Description

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

      Attachments

        Issue Links

          Activity

            michaelhaug michaelhaug added a comment -

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

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

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

            michaelhaug michaelhaug added a comment - Created an attachment (id=925) Patched class hudson.model.node to use custom FileSystemProvisioner instead of default one
            michaelhaug 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 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 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 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.
            og 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.

            og 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.

            People

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

              Dates

                Created:
                Updated: