Skip to content

Commit 63dc9f3

Browse files
committed
🎨增加jenkins质量门禁使用文档
1 parent 8d77774 commit 63dc9f3

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

plugins/jenkins_plugin/README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,21 @@
33
Jenkins 2.277.1及以上
44

55
# 如何使用插件
6-
https://github.com/Tencent/CodeAnalysis/blob/main/plugins/jenkins_plugin/TCA_Jenkins_Plugin.pdf
6+
https://github.com/Tencent/CodeAnalysis/blob/main/plugins/jenkins_plugin/TCA_Jenkins_Plugin.pdf
7+
8+
# 设置质量门禁
9+
10+
1. 在TCA插件配置`质量门禁`参数,填写一个整数,当前分支的扫描问题量大于质量门禁值时,判断为不通过;否则为通过。完成后会将TCA结果状态(`success`|`failure`)输出到工作空间下的`tca_threshold.txt`文件中,供后续步骤判断和终止流水线。
11+
2. 在TCA插件后增加shell命令步骤,输入以下脚本内容:
12+
13+
```commandline
14+
tca_status=`cat tca_threshold.txt`
15+
if [ "${tca_status}" == "success" ]; then
16+
echo ">> tca scan pass!"
17+
else
18+
echo ">> tca scan fail! exit code 255"
19+
exit 255
20+
fi
21+
```
22+
23+
当质量门禁不通过时,会终止流水线(退出码:255)。

0 commit comments

Comments
 (0)