Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display a hyperlink in hudson/jenkins build output console

How do I display a hyperlink (weblink) in hudson/jenkins build output console?

What I'm trying to achieve is, during a hudson/jenkins build based on certain condition, I would like to display a hyperlink. When a user click on that link, it should open a new browser window and show the page.

Is there a plugin to do this? Any suggestions please?

like image 385
enthuguy Avatar asked Nov 01 '15 01:11

enthuguy


1 Answers

When using a (system) groovy script or Jenkins job pipeline (without sandbox) you may want to try e.g.:

import hudson.console.ModelHyperlinkNote
println hudson.console.ModelHyperlinkNote.encodeTo('http://example.com', 'example')

Please find the full API of hudson.console.ModelHyperlinkNote here: http://javadoc.jenkins-ci.org/hudson/console/ModelHyperlinkNote.html

like image 177
Joerg S Avatar answered Sep 22 '22 13:09

Joerg S