鲲鹏社区首页
中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助

构建亲和

stage('affinity-check') {
        steps {
            echo '====== 构建亲和 ======'
            sh '''
            if [ ! -d "./report_dir" ]; then mkdir -p ./report_dir; fi
            /usr/bin/rm -rf ./report_dir/*.html
            devkit advisor constr-check -i /opt/testcase/affinity/build/wtdbg2-2.5 -c make -r html -o ./report_dir
            mv ./report_dir/constr-check*.html ./report_dir/affinity-check.html
            '''
        }
        post {
            always {
                publishHTML(target: [allowMissing: false,
                            alwaysLinkToLastBuild: false,
                            keepAll              : true,
                            reportDir            : './report_dir',
                            reportFiles          : 'affinity-check.html',
                            reportName           : 'vaffinity-check Report']
                            )
            }
        }
}

具体参数如表1所示。

表1 构建亲和参数说明

参数

参数选项

参数说明

-i/--input

package_path

必选参数。对应的源码文件夹路径。

-c/--cmd

cmd

必选参数。源码的构建命令。

-o/--output

output_path

可选参数。报告存放路径。报告默认存放在当前执行路径下,名称默认为“特性名称_时间戳”。

-b/--build-tool

make,cmake

可选参数。构建工具,默认为make。

-l/--log-level

0,1,2,3

可选参数。设置日志等级,0(DEBUG)、1(INFO)、2(WARNING)、3(ERROR),默认为1(INFO)。

-r/--report-type

all,json,html,csv

可选参数。扫描报告的格式。默认为all,即默认生成json、html、csv三种报告。

--set-timeout

time

可选参数。任务超时时间。默认无超时时间,任务将持续执行直到结束。

  • 使用构建亲和功能时,代码示例中需要添加待扫描的源码文件夹路径、源码构建命令、报告输出格式以及报告存放地址。

    格式:devkit advisor constr-check -i 待扫描的源码文件夹路径 -c 源码构建命令 -r 输出报告格式 -o 报告存放地址

    示例:devkit advisor constr-check -i /opt/testcase/affinity/build/wtdbg2-2.5 -c make -r html -o ./report_dir

  • 使用构建亲和功能建议放在构建流程节点前。