Created
September 20, 2016 08:18
-
-
Save matthiasbaldi/52028924fdecf3f69ac8e733a9e1bd5e to your computer and use it in GitHub Desktop.
Jenkins Matching Helper for other Jenkins Groovy Scripts
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
// please set the variable value | |
def partOfJobNameToSearch = "" // set a part of the job name to generate the list of jobs | |
// script - here you have nothing to edit | |
def totCounter = 0 | |
def okCounter = 0 | |
def badCounter = 0 | |
for (item in Jenkins.instance.items) { | |
totCounter++ | |
if (item.name.toLowerCase().contains(partOfJobNameToSearch.toLowerCase())) { | |
okCounter++ | |
println("[MATCHED] " + item.name) | |
} else { | |
badCounter++ | |
} | |
} | |
println("---------------------------------") | |
println("total: ": + totCounter) | |
println("matched: " + okCounter) | |
println("not matched: " + badCounter) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment