Skip to content

Instantly share code, notes, and snippets.

@phaneesh
Last active March 10, 2020 03:59
Show Gist options
  • Save phaneesh/870efea25fb75efda25b9502096cba19 to your computer and use it in GitHub Desktop.
Save phaneesh/870efea25fb75efda25b9502096cba19 to your computer and use it in GitHub Desktop.
Cleanup Jenkins Workspaces (All Projects)
import jenkins.model.*
Jenkins.instance.getAllItems(AbstractProject.class)
.each {
try {
println("Wiping workspace for "+it.fullName)
it.doDoWipeOutWorkspace()
} catch(Exception e) {
println("Error wiping workspace for "+it.fullName)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment