Created
September 7, 2016 19:38
-
-
Save tizki/5c2e590164f11bec7feb5eb460fe8cbc to your computer and use it in GitHub Desktop.
This scripts shows how to get and print basic information about a specific build
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 scripts shows how to get and print basic information about a specific build */ | |
def jenkins = Jenkins.getInstance() | |
def jobName = "myJob" | |
int buildNumber = 186 | |
def job = jenkins.getItem(jobName) | |
//get the build | |
def bld = job.getBuildByNumber(buildNumber) | |
//print some of the builds info | |
println "Build type: ${bld.getClass()}" | |
println "Is buidling: ${bld.isBuilding()}" | |
println "Build URL: ${bld.getUrl()}" | |
println "Build result: ${bld.getResult()}" | |
//println "Environment variables for that build: ${bld.getEnvironment(null)}" | |
println "Build log: ${bld.getLog()}" | |
println "Build artifact: ${bld.getArtifacts()}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment