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?
Usage. To create Groovy-based project, add new free-style project and select "Execute Groovy script" in the Build section, select previously configured Groovy installation and then type your command, or specify your script file name. In the second case path taken is relatively from the project workspace directory.
In the Jenkins dashboard, click Manage Jenkins from the left hand side menu. Then click on 'Configure System' from the right hand side. In the Home directory, you will now see the new directory which has been configured.
The option “Use Groovy Sandbox,” shown below, is available in the Pipeline tab, and it allows the scripts to be run by any user without requiring administrator privileges. In this case, the script is run only by using the internal accessible APIs (which allow you to develop your script by using Groovy).
You can retrieve the information using the Jenkins Script Console which is accessible by visiting http://<jenkins-url>/script .
I had good experience with the following 2 plugins, both were used from within a pipeline:
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.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With