Skip to content

Instantly share code, notes, and snippets.

@actionjack
Forked from superbrothers/hi.groovy
Last active August 29, 2015 14:21
Show Gist options
  • Save actionjack/3539a08bd59d598c9380 to your computer and use it in GitHub Desktop.
Save actionjack/3539a08bd59d598c9380 to your computer and use it in GitHub Desktop.
// vim: set fenc=utf-8 ts=2 sts=2 sw=2 :
import jenkins.model.Jenkins
import groovy.json.JsonBuilder
def jenkins = Jenkins.instance
def ret = [:]
jenkins.items.each {item ->
def list = []
item.builds.each {build ->
list.add(
number: build.number,
duration: build.duration,
timestamp: build.timestamp.timeInMillis
)
}
ret.put item.displayName, list
}
print new JsonBuilder(ret).toString()
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment