Jenkins流水线示例代码
示例代码如下:
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 affi-check -i /opt/testcase/affinity/build/wtdbg2-2.5 -c make -r html -o ./report_dir mv ./report_dir/affi-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'] ) } } }

- 使用构建亲和功能建议放在构建流程节点前。
- “/opt/testcase/affinity/build/wtdbg2-2.5”指待分析的源码文件夹路径,请根据实际情况进行替换。
父主题: 构建亲和