Jenkins: Is there any way to cleanup Jenkins workspace?

Karthik picture Karthik · Feb 23, 2015 · Viewed 216k times · Source

How can I cleanup the workspace in Jenkins? I am using AccuRev as version control tool.

I created freestyle projects in Jenkins.

Answer

Nagendra Singh picture Nagendra Singh · Feb 25, 2015

There is a way to cleanup workspace in Jenkins. You can clean up the workspace before build or after build.

First, install Workspace Cleanup Plugin.

To clean up the workspace before build: Under Build Environment, check the box that says Delete workspace before build starts.

To clean up the workspace after the build: Under the heading Post-build Actions select Delete workspace when build is done from the Add Post-build Actions drop down menu.