Warm tip: This article is reproduced from stackoverflow.com, please click
jenkins jenkins-pipeline workspace

Jenkins Pipeline Wipe Out Workspace

发布于 2020-03-30 21:13:40

We are running Jenkins 2.x and love the new Pipeline plugin. However, with so many branches in a repository, disk space fills up quickly.

Is there any plugin that's compatible with Pipeline that I can wipe out the workspace on a successful build?

Questioner
qmo
Viewed
75
Krzysztof Krasoń 2017-02-20 15:51

You can use deleteDir() as the last step of the pipeline Jenkinsfile (assuming you didn't change the working directory).