Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display an artifact in the jenkins build results page

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!

like image 436
time4tea Avatar asked Feb 15 '12 10:02

time4tea


1 Answers

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.

like image 165
SDC Avatar answered Oct 01 '22 04:10

SDC