Last active
September 7, 2016 18:52
-
-
Save tizki/1224b1859db4be103674d4d09f11d164 to your computer and use it in GitHub Desktop.
This script shows how to get basic information about a job and its builds
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 shows how to get basic information about a job and its builds*/ | |
def jenkins = Jenkins.getInstance() | |
def jobName = "myJob" | |
def job = jenkins.getItem(jobName) | |
println "Job type: ${job.getClass()}" | |
println "Is building: ${job.isBuilding()}" | |
println "Is in queue: ${job.isInQueue()}" | |
println "Last successfull build: ${job.getLastSuccessfulBuild()}" | |
println "Last failed build: ${job.getLastFailedBuild()}" | |
println "Last build: ${job.getLastBuild()}" | |
println "All builds: ${job.getBuilds().collect{ it.getNumber()}}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment