7

I have build that generates a png image archived as an artifact. I would like this to be displayed on the build results page.

I know that by default a link to the image will be there, but I would like the png to be actually visible - using an img tag

I'm sure that there is a plugin for that, but i couldn't find it!

Thanks for any suggestions!

3 Answers 3

15

The easiest way to add an image display to your Jenkins project is to edit the project description.

At the top of the project, on the right, there's an 'edit description' button. This allows you to enter HTML code that will be displayed at the top of the project. Assuming the image you generate has a fixed known URL, you should be able to add it in here.

I've seen this done, for example, with PHP projects that use PDepend to generate code stats graphs. In these cases, the project 'description' might look something like this:

<a href='ws/build/pdepend/overview-pyramid.svg'><img src="ws/build/pdepend/overview-pyramid.svg" type="image/svg+xml" /></a>
<a href='ws/build/pdepend/dependencies.svg'><img src="ws/build/pdepend/dependencies.svg" type="image/svg+xml" /></a>

This would result in the two charts being displayed at the top of the project page.

(You can, of course, enter a regular description text as well).

Hope that helps.

3
  • @time4tea - I'd say more of a work-around than a hack ;-) It does work - see it in action here: the two graphics at the top of the page are the ones I mentioned in the answer. (note I'm not connected with the docblox project; it's just an example of an openly-available jenkins that I know of that uses this technique)
    – SDC
    Mar 12, 2012 at 11:08
  • How would you automate updating the description after a build?
    – k-den
    Apr 6, 2016 at 6:02
  • @k-den: You could link to a picture in the latest artifacts, e.g. <img src="lastStableBuild/artifact/picture.png" type="image/png"/>.
    – Marvin
    Jul 9, 2018 at 12:42
1

Even after using the solution given by SDC, it doesn't worked for me.

After doing some R&D, I observed that it was a bug in Jenkins

https://issues.jenkins-ci.org/browse/JENKINS-22028

and resolved in 1.564 or newer.

To resolve this all you have to do is Manage Jenins> Configure Global Security > and select the markup formatter as RAW HTML.

0

You can use Sidebar-Link Plugin for small images (icons). Otherwise get Chuck Norris Plugin and customize it to your needs.

4
  • Instead of Chuck Norris Plugin you could take the Persona Plugin, easier to customize.
    – pushy
    Feb 15, 2012 at 13:41
  • hmm thanks for that. not quite sure it does what i want though. i just want jenkins to display an image from my build. i don't want to configure different sets of images to display. each build may create a different image. the image will change each time the build runs
    – time4tea
    Feb 15, 2012 at 14:14
  • I believe you can cajole the Sidebar-Link Plugin into displaying a custom image per build. The problem is that you'll need to resize it first. Feb 15, 2012 at 15:06
  • You could try using Image Gallery Plugin, it lets you specify a pattern you could grab all the .jpg or just specify a single image.
    – darkrat
    Aug 13, 2014 at 18:43

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.