Last active
September 7, 2016 18:52
-
-
Save tizki/67e7e87b72c1d2bfef141b3b3e4496a1 to your computer and use it in GitHub Desktop.
This script prints builds of a job by their result
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
/* This script prints builds by their result */ | |
def jenkins = Jenkins.getInstance() | |
def jobName = "myJob" | |
def job = jenkins.getItem(jobName) | |
results = ["SUCCESS","UNSTABLE","FAILURE","ABORTED"] | |
def builfdByResult = { result -> job.getBuilds().findAll{ it.getResult().toString() == result} } | |
results.each { res -> | |
println "Builds ended with result ${res}" | |
println builfdByResult(res) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment