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

Workspace Cleanup Plugin does not copy over "Post-build Actions"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • ws-cleanup-plugin

      This is a fresh install of Jenkins. I installed all the plugins (listed above).

      I then created a Job.

      • Under Build Environment I checked Delete workspace before build starts
      • In the Post-build Actions I simply selected Delete workspace when build is done with no additional changes (That is I did not click on the Advanced button)

      With that in place, I went to Jenkins->New Job and entered a new name, and then picked Copy existing Item giving it the name of the previously created job.

      Upon inspecting the configuration I noticed that

      • Under Build Environment Delete workspace before build starts is correctly selected
      • However under Post-build Actions there is nothing.

      Inspecting the config.xml file of the newly created job tells me that that portion of the configuration did not port over.

      Here is the relevant portion of the ORIGINAL job's configuration

      <publishers>
        <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup@0.26">
          <deleteDirs>false</deleteDirs>
          <skipWhenFailed>false</skipWhenFailed>
          <cleanWhenSuccess>true</cleanWhenSuccess>
          <cleanWhenUnstable>true</cleanWhenUnstable>
          <cleanWhenFailure>true</cleanWhenFailure>
          <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
          <cleanWhenAborted>true</cleanWhenAborted>
          <notFailBuild>false</notFailBuild>
          <cleanupMatrixParent>false</cleanupMatrixParent>
          <externalDelete/>
        </hudson.plugins.ws__cleanup.WsCleanup>
      </publishers>
      <buildWrappers>
        <hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.26">
          <deleteDirs>false</deleteDirs>
          <cleanupParameter/>
          <externalDelete/>
        </hudson.plugins.ws__cleanup.PreBuildCleanup>
      </buildWrappers>
      

      Here is the same portion of the NEW job's configuration

      <buildWrappers>
        <hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.26">
          <deleteDirs>false</deleteDirs>
          <cleanupParameter/>
          <externalDelete/>
        </hudson.plugins.ws__cleanup.PreBuildCleanup>
      </buildWrappers>
      

      As a final attempt I programmatically POST ed the configuration of the original job to another job and I see the same thing happening. For some reason the Post-build Actions are not being applied.

      Just to be sure, I tweaked the original job to have 2 Post-build Actions - and then created a New Job that simply is a Copy of the original one. Again, it did not port over the Delete workspace before build starts in Post-build Actions - However the other action did port over.

      If there are any other details you like me to report on, please let me know.

            vjuranek vjuranek
            looselytyped Raju Gandhi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: