Created
November 1, 2019 22:20
-
-
Save scrain/85b0a72e70b98de0e9d348dce4dcecb9 to your computer and use it in GitHub Desktop.
Jenkins script to find all jobs with specific string in latest build's console output
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
BUILD_STRING = "ERROR" | |
for (job in Jenkins.instance.getAllItems(Job.class)) { | |
if (job.builds[0]?.log?.contains(BUILD_STRING)) { | |
println "${job.name}: ${job.builds[0].id}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment