Hi Annie
Maybe something like
```
def job = Jenkins.instance.getItem("<job-name>")
job.builds.each() {
//println(it.timestamp)
println(it.timeInMillis)
}
```
The timestamp returns a calendar, and the timeInMillis the long value.
I have Jenkins in my Eclipse workspace, and usually first take a look at
github.com/jenkinsci/jenkins, but if
I cannot find what I'm after, I debug the call (e.g. from Api.java or
Build.java) and look at the objects used, and how I could use them in Groovy.
Hope that helps,
Bruno
From: Annie Jiao <[email protected]>
To: [email protected]
Cc: [email protected]
Sent: Saturday, July 11, 2015 9:39 AM
Subject: Re: embed svg created by d3 in plug-in
Actually the output from
http://localhost:8080/jenkins/job/job-name/api/json?tree=builds[timestamp] is
exactly what I need. Is there a way to get this pragmatically in the groovy
script?
On Thursday, July 9, 2015 at 6:24:06 PM UTC-7, Annie Jiao wrote:
Thanks a lot everyone! The scripts library is also very helpful. I'm now having
trouble getting the timestamps of a build — for each project, I want to iterate
through all the builds and get the timestamps. There's the method
getTimeInMillis() that I would like to use, from the api
(http://javadoc.jenkins-ci.org/hudson/model/Run.html), but I don't know how to
access that when I'm iterating over Hudson.instance.items .
On Monday, July 6, 2015 at 5:36:52 PM UTC-7, kinow wrote:
I can try that later in a testing instance that we use to develop the plug-in,
but if you haven't modified the script, the output is probably in the Jenkins
logs (see [1] and [2]).
If you want to display that as parameters, the Active Choices plug-in expects
your script to return an array of strings, being each string rendered as a
parameter of the type selected (e.g. combo box, radio, input text, etc).
Hope that helpsBruno
[1] https://wiki.jenkins-ci.org/display/JENKINS/Logging
[2] https://wiki.jenkins-ci.org/display/JENKINS/Troubleshooting
From: Annie Jiao <[email protected]>
To: [email protected]
Cc: [email protected]
Sent: Tuesday, July 7, 2015 12:12 PM
Subject: Re: embed svg created by d3 in plug-in
https://scriptlerweb.appspot.com/script/show/426002
This looks great for what I'm trying to do. I added that as an "active choice
reactive reference parameter" with the reference parameter field blank, and I
do see the title when I click "build with parameters", but nothing is printed
to the HTML, the browser console, or the Logger Console. Where should i be
looking for the output?
Thank you so much!
On Monday, July 6, 2015 at 3:37:23 PM UTC-7, kinow wrote:
If you are using Groovy, you can use Jenkins API to retrieve this kind of
information. You can have a look at some of the Scriptler scripts
https://scriptlerweb.appspot. com/catalog/list, and also check examples in the
Groovy plug-in, StackOverflow and also check Jenkins' source code
https://github.com/jenkinsci/ jenkins
HTHBruno
From: Annie Jiao <[email protected]>
To: [email protected]
Sent: Tuesday, July 7, 2015 9:41 AM
Subject: Re: embed svg created by d3 in plug-in
This has been incredibly helpful! Thanks!
I see that it reads data from a csv file. Is there a way to populate it with
data from the builds, instead of a preset file? (Suppose I want to plot % of
builds that passed everyday for the past week).
On Wednesday, July 1, 2015 at 5:17:57 PM UTC-7, Ioannis Moutsatsos wrote:
No special plugin needed. You should be able to add some standard HTML
(including an iframe) element to a project's description and it will be
displayed when the job page is rendered. Take a look here where I've added an
animated gif to demo how a build is executed.
Hope this helps to get you started.
On Wednesday, July 1, 2015 at 6:37:51 PM UTC-4, Annie Jiao wrote:
Yup, the svg will change to reflect data as new builds occur. (The navigation
is secondary)
Do I need to install any plug-ins to use an iFrame?
Thanks a lot for your help!
On Wednesday, July 1, 2015 at 12:37:27 PM UTC-7, Ioannis Moutsatsos wrote:
So, will the SVG change as more builds are accumulated in the job history? It
sounds like you want to use it for navigation purposes.You can include a
graphic in your project description using HTML, even an iFrame.
It will then display on the http://localhost:8080/ jenkins/job/jobname/ page
On Wednesday, July 1, 2015 at 2:25:24 PM UTC-4, Annie Jiao wrote:
this'll be on the job level -- as in
http://localhost:8080/jenkins/ job/jobname/
On Wednesday, July 1, 2015 at 7:09:25 AM UTC-7, Ioannis Moutsatsos wrote:
I'm confused from the description of what you are trying to do.Where is this
SVG graphic going to be displayed?
- Job level (ie is this going to be on the build UI) or
- Build report level (ie part of the results after a build)
Depending on one of this options we can suggest some options.
On Tuesday, June 30, 2015 at 5:34:16 PM UTC-4, Annie Jiao wrote:
is it possible to create an svg graphic (non-interactive) using D3 and
embedding the result in a jenkins plug-in?
I do plan on making different parts of the svg clickable and link to other
pages further down the road.
Thanks!
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to jenkinsci-de...@ googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/jenkinsci-dev/19aa8409- edfd-4121-9674-579e4052bf2b% 40googlegroups.com.
For more options, visit https://groups.google.com/d/ optout.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-dev/25f68918-4702-418b-b03d-83a4ff387638%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-dev/2b6c76df-8582-4bec-a9b5-6c58d41d57a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-dev/1650113286.143479.1436604935579.JavaMail.yahoo%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.