Jenkins流水线示例代码
流水线示例代码如下:
stage('byte-alignment-check') {
steps {
echo '====== 字节对齐检查 ======'
sh '''
if [ ! -d "./report_dir" ]; then mkdir -p ./report_dir; fi
/usr/bin/rm -rf ./report_dir/*.html
devkit advisor addr-align -i /opt/DevKit/wtdbg2-2.5 -c make -r html -o ./report_dir
mv ./report_dir/addr-align*.html ./report_dir/byte-alignment-check.html
'''
}
post {
always {
publishHTML(target: [allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll : true,
reportDir : './report_dir',
reportFiles : 'byte-alignment-check.html',
reportName : 'byte-alignment-check Report']
)
}
}
}
- 使用字节对齐检查建议放在构建流程节点前。
- “/opt/DevKit/wtdbg2-2.5”指待扫描的源码文件夹路径,请根据实际情况进行替换。
父主题: 字节对齐检查