find <bParent.build.properties.environment('GIT_TREE')> -mindepth 1 -type d ! -iname images -exec rm -rf {} \;
where <bParent.build.properties.environment('GIT_TREE')> is translated to my working path.
However when I have tried to even print my command at the end of my build execution I end up with an error.
What I have tried (along with some variations) at this point is:
shell(find ${bParent.build.properties.environment['GIT_TREE']} -mindepth 1 -type d ! -iname images ) - this fails with
Script1.groovy: 44: unexpected token: $ @ line 44, column 15.shell( find ${bParent.build.properties.environment['GIT_TREE']} -mindepth 1 -type d ! -iname images
Script1.groovy: 42: unexpected token: bParent @ line 42, column 15.println (find bParent.build.properties.environment['GIT_TREE'] -mindepth 1 -type d ! -iname images)
Either try to use the workspace cleanup plugin and/or some groovy step to do that and retrieve that variable?
My 2 cents
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a51f8bc3-d319-4ca6-b04e-2fea74d542b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ø Either try to use the workspace cleanup plugin and/or some groovy step to do that and retrieve that variable?
We use git, so ymmv. Rather than cleaning up at the end of a build, I just leave it all there and check the “Wipe out repository & force clone” selection in the “Additional Behaviours” section of “Source Code Management”. That will checkout a whole new workspace every time the build starts, which I believe will have the same effect as what you are attempting.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS6QZyvKqxk2cGrJYJ%2B05k68P4g7Dqcqg4zyR_XAnwO02A%40mail.gmail.com.