Using jenkins embeddable build plugin to spruce up confluence and github

I have been using build status plugin for as long as I have been using Jenkins. It has the beauty of giving the current health of the branch at a glance.

or

But it is rather static and in-flexible. I was very glad to see that Thomas Dee took the initiave and gave this plugin a much needed upgrade in 2019. Check out the README.md for more details.

NOTE: If you are like me and don’t know how to install beta jenkins plugins follow this documentation from Jenkins

With the new plugin we can configure quite a few things including the subject (replaces the static build) part and the status. It is also possible to use other jenkins build attributes like duration, id and name. Through which you can get more meaningful meta data about the repo status like this

new build status

To add something like above into github the link looks like this

[![Build Status](https://jenkins.<domain>.com/buildStatus/icon?job=<repo>%2Fdev&subject=Dev%20build%20duration%20${duration})](https://jenkins.<domain>.com/view/<link-to-jenkins-job>)

Adding the query parameter subject will provide customization and it can also take in some variables.

Encoding is tricky and you have to use ‘%20’ for spaces

Embed status into confluence document

  1. Go to jenkins job -> click on embedded build status -> copy unproected markup
  2. In confluence + -> insert markup -> paste from 1
  3. Edit this URL to your liking, taking care of encoding
confluence insert markup dialog

eg: to get a status like ‘Master build duration ${duration}’ encoding becomes

subject=Master%20build%20duration%20%24%7Bduration%7D