Issue Type: Bug Bug
Assignee: Daniel Spilker
Components: job-dsl-plugin
Created: 12/Aug/14 3:37 PM
Description:

When I create a prebuild cleanup using

preBuildCleanup { deleteCommand('sudo rm -rf %s') }

I get the following XML block

<hudson.plugins.ws__cleanup.PreBuildCleanup>
<patterns></patterns>
<deleteDirs>false</deleteDirs>
<cleanupParameter></cleanupParameter>
<deleteCommand>sudo rm -rf %s</deleteCommand>
</hudson.plugins.ws__cleanup.PreBuildCleanup>

However, the deleteCommand tag is wrong. It should be externalDelete. This is what I get when I configure the job directly:

<hudson.plugins.ws__cleanup.PreBuildCleanup>
<deleteDirs>false</deleteDirs>
<cleanupParameter></cleanupParameter>
<externalDelete>sudo rm -rf %s</externalDelete>
</hudson.plugins.ws__cleanup.PreBuildCleanup>

This causes the plugin to not use the command specified. The postbuild cleanup gets the delete command tag right, but has several other differences:

<hudson.plugins.ws__cleanup.WsCleanup>
<patterns/>
<deleteDirs>false</deleteDirs>
<cleanWhenSuccess>true</cleanWhenSuccess>
<cleanWhenUnstable>true</cleanWhenUnstable>
<cleanWhenFailure>true</cleanWhenFailure>
<cleanWhenNotBuilt>true</cleanWhenNotBuilt>
<cleanWhenAborted>true</cleanWhenAborted>
<notFailBuild>false</notFailBuild>
<externalDelete>sudo rm -rf %s</externalDelete>
</hudson.plugins.ws__cleanup.WsCleanup>

from the DSL, versus this block when generated directly:

<hudson.plugins.ws__cleanup.WsCleanup>
<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>sudo rm -rf %s</externalDelete>
</hudson.plugins.ws__cleanup.WsCleanup>

Additionally, the documentation for "Workspace Cleanup Publisher" specifies that the Groovy command to use is "externalDeleteCommand(String)", but it is actually just "deleteCommand(String)".

Project: Jenkins
Priority: Major Major
Reporter: Andy Shulman
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to