forked from ivanaudisio/Jenkins
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckEmptyFolders.groovy
More file actions
30 lines (24 loc) · 1004 Bytes
/
checkEmptyFolders.groovy
File metadata and controls
30 lines (24 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// author : Ivan Audisio
// list folders with no items inside
import hudson.model.*
import hudson.triggers.*
println("-----------------------------------------------------------------------------------------------------------------------------")
println("The following Folders are empty")
println("-----------------------------------------------------------------------------------------------------------------------------")
println("")
jobs = Jenkins.instance.getAllItems()
jobs.each {job ->
if (job instanceof com.cloudbees.hudson.plugins.folder.Folder) {
items = job.getItems()
if (items.size() == 0) {
println("Name : ${job.name}")
println("Class : ${job.class}")
println("Root Dir : ${job.rootDir}")
println("URL : ${job.url}")
println("Absolute URL: ${job.absoluteUrl}")
println("")
println("")
}
}
}
println("-----------------------------------------------------------------------------------------------------------------------------")