Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Clear Jenkins Sandbox Folder from jobs
import hudson.model.*
def isFolder = { it.class.canonicalName == 'com.cloudbees.hudson.plugins.folder.Folder' }
def isSandbox = { "sandbox" == it.fullName }
def deleteChildren = {
it.getItems().collect { item ->
def deletedName = item.fullName
"${deletedName} deleted"
def findAndClearSandbox = { allJobs ->
["\nJobs found and removed in sandbox",
.join('\n') ?: 'Nobody has been using the sandbox this week. :(',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.