清理被禁用的作业
Jenkins : Delete workspace for all disabled jobs
Want to delete Jenkins jobs – Stack Overflow
//michaeldkfowler import jenkins.model.* Jenkins.instance.getAllItems(AbstractProject.class) .findAll {it.disabled} .each { println("Wiping workspace for "+it.fullName) it.doDoWipeOutWorkspace() // 清理禁用作业所占用的磁盘 // it.delete() // 删除 Job }