如何使用脚本化管道在詹金斯构建描述中添加超链接

Pau*_*aul 4 html java groovy jenkins jenkins-pipeline

使用 jenkins 构建描述插件我想打印我的网络驱动器的路径。

下面的代码工作正常。


        stage('print') {
            env.SMBuildDescription="Build path:"+"${buildpath}"
            currentBuild.description=SMBuildDescription
        }
Run Code Online (Sandbox Code Playgroud)

但我想添加构建路径作为超链接。

Mar*_*atC 5

尝试这个:

stage('print') {
            currentBuild.description = """Build path: <a href="${buildpath}">Link</a> """
        }
Run Code Online (Sandbox Code Playgroud)

仅当Jenkins 实例上的 /configureSecurity/ 下Markup Formatter设置为Safe HTML(而不是)时,此功能才有效。Plain text