Is there a way to make jenkins serve up script generated pages?

282 views
Skip to first unread message

Jonathan Hodgson

unread,
Oct 19, 2016, 5:57:41 PM10/19/16
to Jenkins Users
Okay, so here's the situation.

I have build logs in xml format, and an sxlt file to convert them to nice pretty html.

Currently the way I'm doing this is with an html and js file in userContent to apply the xslt on the client end, so I have a ;link on my build page that is

/userContent/msbuild/MSBuildLog.html?logxml=/job/MyBuild/1043/artifact/Win32_Release_build_log.xml

MsBuildLog.Htnl being the wrapper page that loads the xml file from the artifact link, applies the xslt transform and displays the result.

Now this works correctly, and is usable

GOOD SIDE:
I can change the xslt file to improve the display of the log. This is important because at the moment the XSLT is very much a work in progress, and since I'm cimpletely new to XSLT I expect it to remain so for quite a while (especially as I'm supposed to be spending most of my time on actual deliverable code rather audo build stuff). Doing a one off conversion at build time and artifacting the generated html really isn't viable for the moment

BAD SIDE:
It's slow. Ok not unusably so, but certainly enough to be irritating and mess with my workflow. 

So the ideal would be to do something similar on the server end. If I was running everything in Apache, no issue, I could use PHP, but I don't think that's an option here if I'm just using theJenkins server.

Is there a way to do this that anybody knows?

Teichner Peter

unread,
Oct 19, 2016, 7:13:01 PM10/19/16
to Jenkins Users

On Linux you have a tool called xsltproc which basically does the transformation. Assuming your Jenkins is Windows you could get something similar I'm sure.

To display the HTML there is a plugin for Jenkins that will let you link in static pages to the job

Get Outlook for Android

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/16e6fb5f-5385-4f04-9312-44640e781359%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jonathan Hodgson

unread,
Oct 19, 2016, 8:43:29 PM10/19/16
to Jenkins Users, peter.t...@nagra.com


On Thursday, October 20, 2016 at 12:13:01 AM UTC+1, Teichner Peter wrote:

On Linux you have a tool called xsltproc which basically does the transformation. Assuming your Jenkins is Windows you could get something similar I'm sure.

To display the HTML there is a plugin for Jnkins that will let you link in static pages to the job

Thanks, but I think you may have missed the point, perhaos I wasn't cleat enough.

I need this to be dynamic, if I convert the xml amd archive it as an html file, then it is stuck like that, regardless of improvements I make in the xslt... which needs a lot of work.

Michael Lasevich

unread,
Oct 25, 2016, 11:10:26 PM10/25/16
to Jenkins Users, peter.t...@nagra.com
I think pretty much every browser will do XML+XSL conversion without any plugin, although if you want a "shared" XSL file, you may have to add a stylesheet tag to point to it inside your XML

So all you do is archive your XML with stylesheet tag and a shared location for your XSL file and you are done.

-M

Michael Lasevich

unread,
Oct 26, 2016, 3:03:25 AM10/26/16
to Jenkins Users, peter.t...@nagra.com
I clearly did not read the original post carefully enough

I would examine your XSLT, as it should normally perform pretty fast, if written right, but if you really want to do this ahead of time, but still be able to redo it whenever XSLT changes, your easiest way to go is to write a separate job that takes the output XML from your main job and applies XSLT and produce HTML output - then you can re-run it whenever XSLT changes (you can even have it automated)

Still seems like easier approach is fix the XSLT to be faster. I would also make sure compression is enabled on whatever web-server you are serving Jenkins from.

HTH,

-M
Reply all
Reply to author
Forward
0 new messages