Created
December 4, 2011 18:07
-
-
Save kellyrob99/1430856 to your computer and use it in GitHub Desktop.
Example of parsing out the artifacts of the last successful build on Jenkins/Hudson using the JSON api
This file contains 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
import groovy.json.* | |
def HOSTNAME = 'http://ci.jruby.org' | |
def JOBNAME = 'jruby-dist' | |
def JOB_URL = "$HOSTNAME/job/$JOBNAME/lastSuccessfulBuild" | |
def text = "$JOB_URL/api/json".toURL().text | |
println JsonOutput.prettyPrint(text) | |
def json = new JsonSlurper().parseText(text) | |
json.artifacts.each{ | |
println it | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment