Skip to content

Instantly share code, notes, and snippets.

@superbrothers
Created March 21, 2014 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save superbrothers/9681213 to your computer and use it in GitHub Desktop.
Save superbrothers/9681213 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
@superbrothers
Copy link
Author

% curl -d "script=$(cat hi.groovy)" http://localhost:8080/scriptText

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment