---
title: Jenkins流水线示例代码
description: "流水线示例代码如下："
url: https://www.hikunpeng.com/document/detail/zh/nativedevp/userguide/pipeline/NativeDevelopment_0090.html
sourcePath: /source/zh/nativedevp/userguide/pipeline/NativeDevelopment_0090.html
indexId: 8ad5594f5aad9f752e8c465e86b5518629ce9c6a7be3cb907e75db0fa314b1b668
---
# Jenkins流水线示例代码

流水线示例代码如下：

```
stage('memory-consistency-check') {
steps {
echo '====== 内存一致性检查 ======'
sh '''
if [ ! -d "./report_dir" ]; then mkdir -p ./report_dir; fi
/usr/bin/rm -rf ./report_dir/*.html
mkdir -p
/opt/DevKit/testcase/affinity/weak_cons/bc_file
cd
/opt/DevKit/testcase/affinity/weak_cons/test-mulbc_sort
devkit advisor bc-gen -c make -o
/opt/DevKit/testcase/affinity/weak_cons/bc_file
devkit advisor mm-check -i
/opt/DevKit/testcase/affinity/weak_cons/test-mulbc_sort
-f
/opt/DevKit/testcase/affinity/weak_cons/bc_file
-r html -o ./report_dir
mv ./report_dir/mem-check*.html ./report_dir/memory-consistency-check.html
'''
}
post {
always {
publishHTML(target: [allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll              : true,
reportDir            : './report_dir',
reportFiles          : 'memory-consistency-check.html',
reportName           : 'memory-consistency-check Report']
)
}
}
}
```

- 使用内存一致性检查建议放在构建流程节点前。
- “/opt/DevKit/testcase/affinity/weak_cons/bc_file”指生成BC文件的存放路径，请根据实际情况进行替换。
- “/opt/DevKit/testcase/affinity/weak_cons/test-mulbc_sort”指需要生成BC文件的源码文件夹路径，请根据实际情况进行替换。
