Last active
January 10, 2017 11:30
-
-
Save scrain/0a4259c66e2f735af1b3cc61ca1dc2ea to your computer and use it in GitHub Desktop.
Jenkins script to find all jobs with a file in the workspace containing a string
This file contains hidden or 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 allJobs = hudson.model.Hudson.getInstance().allItems.findAll { it instanceof hudson.model.AbstractProject } | |
allJobs.findAll{ | |
it.someWorkspace?.list().find{ f -> | |
( !f.isDirectory() && f.name.endsWith('.gradle') && f.readToString().contains('some string') ) | |
} | |
}.each { | |
println "${it.name}\t${it.absoluteUrl}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment