Last active
November 1, 2019 22:00
-
-
Save scrain/7c93322d7c587a458b51982f4e9798c6 to your computer and use it in GitHub Desktop.
Jenkins script to report jobs by the JDK used
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def jobsWithJdkSupport = Jenkins.instance.getAllItems(Job.class).findAll{it.hasProperty('JDK')} | |
def jdksInUse = jobsWithJdkSupport.collect{it.JDK?.name}.unique() | |
println "jdks in use: ${jdksInUse}\n" | |
jdksInUse.each{ jdk -> | |
println "jdk '${jdk}'" | |
jobsWithJdkSupport.findAll{ it.JDK?.name == jdk }.each { job -> | |
println "\t${job.name}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment