我目前正在尝试将我以前的“GUI”构建步骤转换为管道常规脚本。我以前从 valgrind plugin 迈出一步发布 valgrind 运行的结果。
我在管道语法片段生成器中找到了“step:General Build Step”函数,并尝试使用它通过以下代码创建 valgrind 发布结果步骤:
// file pipeline.groovy
import org.jenkinsci.plugins.valgrind.*;
...
node('Publish Valgrind results')
{
step([$class: 'ValgrindPublisher', ValgrindPublisherConfig: [$class: 'ValgrindPublisherConfig', pattern: 'CppCodeBase/Generated/ValgrindOutput/**']])
}
...
当我运行这个 Jenkins 提示时:
java.lang.UnsupportedOperationException: no known implementation of interface jenkins.tasks.SimpleBuildStep is named ValgrindPublisher
所以我不确定问题是否在于 ValgrindPublisher
仅源自 BuildStep
而不是源自 SimpleBuildStep
或者我的导入是否有错误。
更普遍的问题是:
是否可以从管道脚本中的插件运行任何构建步骤,如果可以,在哪里可以找到示例?
最佳答案
不,你不能。您只能使用 pipelines-compatible plugins 中的步骤看来您的 ValgrindPublisher
插件(尚)不兼容管道。
您可以查看this answer获取类似信息。
关于jenkins - 我可以使用 step() 从任何插件创建任何构建步骤吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40737548/