Hi! Does anyone know how to add hyperlink to Jenkins yaml pipeline so it’s clickable in Jenkins job on web?
Thanks!
If the markdown formatter plugin is installed, then the following Pipeline definition will place a hyperlink in the job description:
pipeline {
agent any
stages {
stage('Hello') {
steps {
echo 'Hello World'
script {
currentBuild.displayName = "Display name #${currentBuild.number}"
currentBuild.description = "Build description #${currentBuild.number} [ABC](https://jenkins.io/)"
}
}
}
}
}
When that job runs, the build history will look like this:
The embeddable build status plugin can be used in combination with the markdown formatter plugin to embed the status links for one or more jobs in the job description of a Jenkins folder. When I do that, the folder looks like this:
Thanks for answer. Sorry for confusing, I meant how to add the link to yaml file that is used for jenkins job builder and has such structure:
- job:
display-name: “text”
name: text
project-type: pipeline
folder: “text”
concurrent: true
sandbox: true
properties:
build-discarder:
days-to-keep: 1
parameters:
- raw:
xml:
text.yaml.inc
- raw:- extended-choice:
name: text
type: ‘text’
value: text
visible-items: 1
description: “Text”
- extended-choice:
I need to add hyperlink to description section but don’t know how
The default formatter allows basic html i belive, you can just use <a href="/something">link</a>
. But as mark mentioned (he and I are both biased) the markdown formatter will give you a lot more options for descriptions.