gpt4 book ai didi

jenkins - 如何正确使用Jenkins警告下一代插件的三个步骤?

转载 作者:行者123 更新时间:2023-12-03 16:56:47 25 4
gpt4 key购买 nike

用于管道的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命令旨在用于简单的用例,而scanForIssuespublishIssues命令旨在用于更复杂的用例。

    因此,您对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/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com