在Jenins 2 Pipeline脚本中使用任意插件 [英] Using an arbitrary plugin in Jenins 2 Pipeline scripts
问题描述
使用Jenkins 2中的 Snippet Generator 工具,我可以像在工作中一样设置一个插件,然后它将生成可以在我的Pipeline脚本中使用的Groovy.
Using the Snippet Generator tool in Jenkins 2, I can setup a plugin like I would within a job, and then it will generate me the Groovy I can use in my Pipeline script.
但是如果 Snippet Generator 的示例步骤"下拉列表中没有列出我感兴趣的插件,该怎么办?如何确定如何创建脚本块来检测要使用的插件?
But what if the plugin I am interested in instrumenting isn't listed in the "Sample Step" drop down in the Snippet Generator? How do I determine how to create a script block to instrument the plugin I want to use?
就我而言,我想使用"灵活发布"管道脚本中的插件.
In my case, I would like to use the "Flexible Publish" plugin within my Pipeline script.
推荐答案
您不能使用通常与管道不兼容的插件. 插件需要或多或少地进行修改以兼容. 参见 https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md
You can't use plugins which are not compatible with pipeline generally. Plugins need to be modified more or less to be compatible. See https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md
这篇关于在Jenins 2 Pipeline脚本中使用任意插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!