Make an URL a result of Hudson build
If you want markup to be treated as such, you must enable it: Manage Jenkins > Global Security > Markup Formatter = Safe HTML
Then, for Jenkins scripted pipelines, you can simply set the currentBuild.description
property with some HTML. Example:
currentBuild.description = "Click <a href='http://yourlink'>here</a>"
The rendered HTML will show in the build history and on the build page.
If you don't see "Safe HTML" in the Markup Formatter drop-down, you probably need to install the OWASP Markup Formatter plugin.
At the time of this post, the Blue Ocean GUI will not display HTML for build descriptions. See issue here: https://issues.jenkins.io/browse/JENKINS-45719
This Chrome extension can serve as a workaround: https://chrome.google.com/webstore/detail/blue-ocean-description-ht/maahpenodjcdhodbonmdkfgnceddigae
Per job run? Or global for the whole job?
If your link is always static (example: latest artifacts only), you can use a Sidebar link plugin. https://wiki.jenkins-ci.org/display/JENKINS/Sidebar-Link+Plugin that will place a static link per job (for all runs).
If your link changes per run, here is what I do in my environment. I update the run's description with an <a href>
tag. The link won't show on the run page, however it works rather nicely in the build history.
Note above, the [Debug]
and [Release]
are unique links for each particular build.
For this, you would need Description Setter Plugin. https://wiki.jenkins-ci.org/display/JENKINS/Description+Setter+Plugin. And in the plugin (it is post-build action), just write pure HTML. You can use usual environment variables in there
<a href="http://whatever/${BUILD_NUMBER}">Link here</a>
Edit: note that nowadays it isn't that easy (if at all possible) to put html in the build history description. It does work on the individual build page.