Adding javascript to job status page

103 views
Skip to first unread message

Annie Jiao

unread,
Jul 21, 2015, 5:00:27 PM7/21/15
to Jenkins Developers
Hello!

I'm trying to use d3 to generate data visualization on the job status page (http://localhost:8080/jenkins/job/job-name/)

currently I'm using the active choices plugin and using a groovy script in the parameter I'm able to put the result on the "build with parameters" page (http://localhost:8080/jenkins/job/job-name/build?delay=0sec)

Is there a plugin I could use or somewhere in the config file where I can put the svg on the description page instead?

Thanks!

Bruno P. Kinoshita

unread,
Jul 22, 2015, 1:01:40 AM7/22/15
to jenkin...@googlegroups.com
Hi Annie

Maybe in the job description? You can include HTML there, and try to add a link to an image archived in the latest successful build. Some times I use the Image Gallery Plug-in for doing something similar (displaying graphs generated with R), you may want to take a look if that's helpful too.

Hope that helps,
Bruno


From: Annie Jiao <annie...@gmail.com>
To: Jenkins Developers <jenkin...@googlegroups.com>
Sent: Wednesday, July 22, 2015 9:00 AM
Subject: Adding javascript to job status page

--
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/f8b5c1d4-ff2a-4bd2-94ab-d349886c4a31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Annie Jiao

unread,
Jul 22, 2015, 4:23:21 PM7/22/15
to Jenkins Developers, brunod...@yahoo.com.br
Hello!

Yes -- that would work! Do you know if there's a way that after each build, I can:

  1. run some javascript to generate the svg
  2. store the svg in the same URL as the previous build 
  3. the description is updated in reload (the svg url doesn't change)
I currently don't know how to generate the svg and get it hosted after a build. Thanks!

Annie

Bruno P. Kinoshita

unread,
Jul 23, 2015, 4:16:57 AM7/23/15
to Annie Jiao, Jenkins Developers
Hi Annie

Comments below

>Yes -- that would work! Do you know if there's a way that after each build, I can:

> 1. run some javascript to generate the svg

You can have a build step, post build step, call another job, use the workflow plug-in, etc. The simplest would be to include a command that generates the SVG graph in your build, but there are many different ways to achieve the same result.

> 2. store the svg in the same URL as the previous build

If you archive your image as a build artifact. The URL won't change.

> 3. the description is updated in reload (the svg url doesn't change)


You can browse the configuration for that job for an example. Normally I use R to generate the graphs, but due to lack of time I decided to simply wget an image once and pretend I've generated it with some command :)

HTH
Bruno


From: Annie Jiao <annie...@gmail.com>
To: Jenkins Developers <jenkin...@googlegroups.com>
Cc: brunod...@yahoo.com.br
Sent: Thursday, July 23, 2015 8:23 AM
Subject: Re: Adding javascript to job status page
Reply all
Reply to author
Forward
0 new messages