用于管道的Jenkins警告下一代插件的documentation指定了三个步骤变体:
publishIssues
:发布由静态分析扫描recordIssues
:记录编译器警告和静态分析结果scanForIssues
:扫描文件或控制台日志以获取警告或问题我刚刚尝试了以下简单代码段:
stage('QA checks') {
steps {
recordIssues([
enabledForFailure: true,
tools: [php()]
])
}
}
并将结果显示在构建页面上(“PHP运行时:无警告”)。但是,另外两个步骤的意义是什么?
配置插件的正确方法是什么?应该像这样使用这三个部分吗?
stage('QA checks') {
steps {
scanForIssues([...])
recordIssues([...])
publishIssues([...])
}
}
最佳答案
来这里问同样的问题。从文档中找出来。 https://github.com/jenkinsci/warnings-ng-plugin/blob/master/doc/Documentation.md
总之,recordIssues
命令旨在用于简单的用例,而scanForIssues
和publishIssues
命令旨在用于更复杂的用例。
因此,您对recordIssues
的用法似乎完全符合作者的意图。
从documentation:
Advanced Pipeline configuration
Sometimes publishing and reporting issues using a single step is not sufficient. E.g., if you build your product using several parallel steps and you want to combine the issues from all of these steps into a single result. Then you need to split scanning and aggregation. The plugin provides the following two steps:
scanForIssues
: this step scans a report file or the console log with a particular parser and creates an intermediate AnnotatedReport object that contains the report. [...]publishIssues
: this step publishes a new report in your build that contains the aggregated results of several scanForIssues steps. [...]
关于jenkins - 如何正确使用Jenkins警告下一代插件的三个步骤?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61428125/