6

I am very reluctant to jump into having to write a full fledged plugin, and I only know of one way to inject some information onto the build status screen of a build: set the build description.

I would like to display and dynamically update a more complex piece of rendering onto the build status page from a groovy system script. What is the best way to achieve it? Do I have to write a full plugin and grok the whole stapler paradigm?

Christian Goetze
  • 2,254
  • 3
  • 34
  • 51
  • 1
    I guess what would be cool is to have a plugin which takes care of the mess and provides a simple `render()` function to render any html on the build status page - pretty much the way description works, without the side effect of also decorating the build list. – Christian Goetze Oct 08 '15 at 18:10
  • 1
    Christian, you can. Look at https://wiki.jenkins-ci.org/display/JENKINS/Summary+Display+Plugin and it's sources https://github.com/jenkinsci/summary_report-plugin – Stan E Oct 11 '15 at 09:54
  • What I need is a progress report, preferably updating live while the build is going on. Publishing results once done, there are plenty of plugins for that. – Christian Goetze Oct 11 '15 at 23:48
  • Bit what information do you want to publish? – Stan E Oct 12 '15 at 06:18
  • I mean, statuses, build log, something else? In fact you can read build log, for instance. But it wouldn't be achievable from Groovy script, as it would be just a build step. – Stan E Oct 12 '15 at 06:20
  • My immediate goal is to implement a status display similar to the one used by the multijob plugin. This is to build out an alternative job scheduler, which I asked about here: http://stackoverflow.com/questions/32704360/how-can-i-trigger-a-jenkins-job-upon-completion-of-a-set-of-other-jobs – Christian Goetze Oct 12 '15 at 15:09
  • 2
    I think you are looking for something like the 'Workflow Stage View Plugin' of the Enterprise Jenkins' version. – Mario R.C. Oct 15 '15 at 10:11
  • 1
    You can check this link too: https://www.youtube.com/watch?v=LOmFXFq3Uzg – Mario R.C. Oct 15 '15 at 10:20
  • I guess if I shell out the big bucks for CloudBee's solution, I might get what I want... It's not that I am disinclined to shell out big bucks, it's the fact that it will take me about a year of using it to decide whether it was worth it... – Christian Goetze Oct 16 '15 at 17:57

1 Answers1

2

I had good experience with the following 2 plugins, both were used from within a pipeline:

  1. The Groovy Postbuild Plugin - just use manager.createSummary and add HTML to it. I found this to be easy to implement, with great UI results - it looks like built-in Jenkins sections. This is my personal recommendation.
  2. As already suggested by stanjer, The Summary Display Plugin also works. However, it is more cumbersome to use, as you need to generate a custom XML file with non-standard HTML tags in it, then add it as a build artifact and reference to it from the plugin.
Oren Chapo
  • 519
  • 7
  • 15
  • These add entries after the build completes. What I'd like is something I can insert while the build is still in progress, – Christian Goetze Sep 18 '17 at 16:29
  • True about "Summary Display", but from what I've seen, the "Groovy Postbuild" does that during the build. You may also use a "parallel" block inside a pipeline, with one executor doing the actual job, while the other checks and updates the status. – Oren Chapo Sep 18 '17 at 19:34