---
title: Jenkins流水线示例代码
description: "示例代码如下："
url: https://www.hikunpeng.com/document/detail/zh/nativedevp/userguide/pipeline/NativeDevelopment_0093.html
sourcePath: /source/zh/nativedevp/userguide/pipeline/NativeDevelopment_0093.html
indexId: 4389b43d03089707d8600d045f2dbf9252134e49004a86338b88d0ac44f490c068
---
# 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
cd
/home/testcase/cplusproject
devkit advisor bc-gen -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/advisor/bc_file”指BC文件路径，请根据实际情况进行替换。
- “/home/testcase/cplusproject”指BC文件对应的源码文件夹路径，请根据实际情况进行替换。
