I'm working on this plugin https://plugins.jenkins.io/sidebar-link/ to add a link in jenkins side bar. This plugin works with jenkins project configuration. Now I'm trying to add a pipeline step to call this plugin.
I already try lines of code below but it's not working
sidebarLinks {
link("my_url", "the title", 'image path')
}
I already read thread on this but no accepted responses found. I think that jenkins plugin are not well documented.
Does anybody know how can I use it with pipeline?
Updated
I'm using a shared library written in Groovy. This library holds all pipeline methods.
@Library('xxxx@v1.0.0') _
pipeline {
stages {
...
stage('Add side link') {
steps {
addLink()
}
}
}
}
Shared library side, I've an addLink.groovy file.
def call(){
properties {
sidebarLinks {
link("url", 'Title', 'icon_path')
}
}
}
I've got error below :
ERROR: <- : java.lang.IllegalArgumentException: Could not instantiate {properties=org.jenkinsci.plugins.workflow.cps.CpsClosure2@6b5322b} for JobPropertyStep