Jenkins流水线示例代码
示例代码如下:
stage('vectorized-check') { steps { echo '====== 向量化检查 ======' sh ''' if [ ! -d "./report_dir" ]; then mkdir -p ./report_dir; fi /usr/bin/rm -rf ./report_dir/*.html mkdir -p /home/advisor/bc_file devkit advisor bc-gen -i /home/testcase/cplusproject -c make -o /home/advisor/bc_file devkit advisor vec-check -i /home/testcase/cplusproject -f /home/advisor/bc_file -c make -r html -o ./report_dir mv ./report_dir/vec-check*.html ./report_dir/vectorized-check.html ''' } post { always { publishHTML(target: [allowMissing: false, alwaysLinkToLastBuild: false, keepAll : true, reportDir : './report_dir', reportFiles : 'vectorized-check.html', reportName : 'vectorized-check Report'] ) } } }

- 使用向量化检查建议放在构建流程节点前。
- “/home/testcase/cplusproject”指BC文件对应的源码文件夹路径,请根据实际情况进行替换。
- “/home/advisor/bc_file”指BC文件路径,请根据实际情况进行替换。
父主题: 向量化检查