How to display hyperlink in hudson / jenkins build output console

How to display a hyperlink (web link) in hudson / jenkins create an output console?

What I'm trying to achieve, during a state-based hudson / jenkins build, I would like to display a hyperlink. When the user clicks on this link, he should open a new browser window and show the page.

Is there a plugin for this? Any suggestions please?

+5
source share
2 answers

If you enter, for example:

echo 'http://example.com' 

in the Build step. Run shell → The address command will be a hyperlink in the Console output, but not with target="_blank" . But with an average click on it, a new tab or window opens - depending on the browser settings.

+2
source

When using the groovy script or Jenkins pipeline (system) (without the sandbox) you can try, for example:

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

Here you will find the full hudson.console.ModelHyperlinkNote API: http://javadoc.jenkins-ci.org/hudson/console/ModelHyperlinkNote.html

+3
source

Source: https://habr.com/ru/post/1234935/


All Articles