9

I'm using Promoted Builds Plugin to assign certain icons to Jenkins jobs on certain conditions and I'd like to publish these promotion icons.

How can I generate external links to these icons per each job, so they're accessible externally?

—————

For example I'd like to create the table in README.md on GitHub like:

Job 1 | ![](link_to_icon_of_job_1)
Job 2 | ![](link_to_icon_of_job_2)
Job 3 | ![](link_to_icon_of_job_3)
kenorb
  • 8,011
  • 14
  • 43
  • 80

2 Answers2

11

The "Embeddable Build Status Plugin" will do exactly that.

Note: This requires your Jenkins server to be accessible from the internet if you're using GitHub because they cache all images in their CDN.

kenorb
  • 8,011
  • 14
  • 43
  • 80
Travis Thompson
  • 404
  • 4
  • 10
4

I was trying to do something similar (embed build status icons into email notifications) but since our build system is not publicly accessible, I ended up posting the status icons to imgur and referencing those images by storing the URL in variables according to state.

Here are some snippets from my email template Groovyscript:

Defining the URLs:

def images = [:]
images["SUCCESS"] = "http://i.imgur.com/uXlqCxW.gif"
images["PASSED"] = "http://i.imgur.com/uXlqCxW.gif"
images["UNSTABLE"] = "http://i.imgur.com/QkQbxR3.gif"
images["SKIPPED"] = "http://i.imgur.com/QkQbxR3.gif"
images["FAILURE"] = "http://i.imgur.com/LUveOg7.gif"
images["FAILED"] = "http://i.imgur.com/LUveOg7.gif"
images["ABORTED"] = "http://i.imgur.com/jSdrWWP.gif"
images["NOT_RUN"] = "http://i.imgur.com/jSdrWWP.gif"

Using the URLs in the email:

<img src="${images[build.result.toString()]}" />
heemayl
  • 103
  • 2
lawnmowerlatte
  • 442
  • 1
  • 3
  • 13