当前位置:网站首页>Gerrit触发Jenkins SonarQube扫描
Gerrit触发Jenkins SonarQube扫描
2022-06-12 16:46:00 【@TangXin】
环境参考:Gerrit+2触发Jenkins任务
描述:记录Gerrit +2 操作之后,自动触发Jenkins工程执行,SonarQube工具对代码进行静态扫描,如果扫描成功,Gerrit自动+1,如果扫描失败,Gerrit自动-1
1.Jenkins配置
Jenkins中配置 Gerrit Trigger,当Jenkins任务执行成功,Gerrit Code Review +1,当Jenkins任务执行失败,Gerrit Code Review -1
2.Jenins-构建
sonar.projectKey=test1
sonar.projectName=test1
sonar.sourceEncoding=UTF-8
sonar.projectVersion=${BUILD_TAG}
sonar.language=python
sonar.sources=${WORKSPACE}/test
sonar.projectBaseDir=${WORKSPACE}/test
sonar.qualitygate.wait=true
sonar.qualitygate.timeout=3000
3.SonarQube设置质量阈
SonarQube针对项目设置质量阈之后,Jenkins中SonarQube任务执行时,如果满足质量阈,则Jenkins任务执行成功,否则执行失败。
Gerrit+2后,自动触发Jenkins中SonarQube任务执行,当不满足质量阈设置时,任务执行失败
SonarQube页面显示,新代码扫描失败
4.Gerrit显示
Gerrit -1 操作
边栏推荐
猜你喜欢
Swin transformer code explanation
uabntu的sudo
Extract the new Chinese cross modal benchmark zero from 5billion pictures and texts, and Qihoo 360's new pre training framework surpasses many SOTAS
MongoDB 学习整理(用户,数据库,集合,文档 的基础命令学习)
Google浏览器调试技巧
Qt开发高级进阶:初探qt + opengl
并发包和AQS
博士申请 | 新加坡国立大学Xinchao Wang老师招收图神经网络方向博士/博后
canvas 高级功能(下)
Unit sshd.service could not be found
随机推荐
Servlet API
Demande de doctorat | xinchao Wang, Université nationale de Singapour
\Begin{algorithm} notes
图片在线收款发货系统源码
双写一致性问题
(六)控制语句if/else switch
[adult Liu Er - pytorch deep learning practice] notes with learning (I)
Mongodb learning and sorting (basic command learning of users, databases, collections and documents)
redis. clients. jedis. exceptions. JedisConnectionException: Could not get a resource from the pool
890. find and replace mode / Sword finger offer II 080 Combination with k elements
IDEA在控制台显示出services,统一管理所有的jetty服务,
Joint recruitment notice of ganfei research group of Wuhan University and xuzhenjiang research group of Nanchang University
Male god goddess voting source code v5.5.21 voting source code
Leetcode 2190. 数组中紧跟 key 之后出现最频繁的数字(可以,一次过)
Recommend AI intelligent drawing repair software
js监听用户是否打开屏幕焦点
Google browser debugging skills
JVM内存模型与本地内存
js 使用Rsa 加密 解密
How to base on CCS_ V11 new tms320f28035 project