Created
March 21, 2014 07:19
-
-
Save superbrothers/9681213 to your computer and use it in GitHub Desktop.
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
// 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 |
Author
superbrothers
commented
Mar 21, 2014
- Jenkins Script Console - Jenkins - Jenkins Wiki
- Overview (Jenkins main module 1.555 API)
% 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