I would like to have pre-flight checks for my Jenkins pipeline that test whether a certain plugin is installed or not. I found this post Check a plugin exists within a Jenkins Pipeline (Groovy) which asks the same question, but the answers provided are not usable for me, since they test whether a DSL method provided by the plugin is available and not, whether the plugin in general is available or not.
What I would like to have is something like this (in my Jenkinsfile
):
pluginAvailable('plugin-name', '0.0.1')
where 0.0.1
might be a (optional) minimum version.
Is there anything like that in the Pipeline DSL or another Jenkins class?