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

Clean workspace prior to release build

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: release-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

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

        Attachments

          Issue Links

            Activity

            Hide
            michaelhaug michaelhaug added a comment -

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

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

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

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

            Show
            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.
            Hide
            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.

            Show
            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

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

                Dates

                Created:
                Updated: