我已经尝试了以下代码行,但它没有生效。
sidebarLinks {
link("my_url", "the title", 'image path')
}
我已经阅读了相关的线程,但没有得到任何被接受的回应。
我认为Jenkins插件的文档不太好。
是否有人知道如何在流水线中使用它?
更新
我正在使用用Groovy编写的共享库。这个库包含所有流水线方法。
@Library('xxxx@v1.0.0') _
pipeline {
stages {
...
stage('Add side link') {
steps {
addLink()
}
}
}
}
在共享库方面,我有一个addLink.groovy文件。
def call(){
properties {
sidebarLinks {
link("url", 'Title', 'icon_path')
}
}
}
我遇到了下面的错误:
ERROR: <- : java.lang.IllegalArgumentException: Could not instantiate {properties=org.jenkinsci.plugins.workflow.cps.CpsClosure2@6b5322b} for JobPropertyStep
groovy
脚本来导航到URL吗?你是想在运行时显示一个链接在左侧菜单中吗? - mdabdullah