Gitlab 与 SonarQube 的集成 [英] Gitlab integration with SonarQube

查看:99
本文介绍了Gitlab 与 SonarQube 的集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是开发社区的新手,特别是 DevOps 实践,作为我们尝试将 SonarQube 与 Gitlab 集成的项目的一部分,我做了一些 R&D on SonarQube 和 Git CI(持续集成),看起来插件是为 Github 和 SonarQube 发布的,而不是为 Gitlab 发布的.

I am pretty new to Development community and specifically to DevOps practices , as a part of project we are trying to integrate SonarQube with Gitlab , did some R& D on SonarQube and Git CI ( Continuous Integration ) and look like plugin is released for Github and SonarQube whereas not for Gitlab.

使用 SonarQube 配置 GitLab 以检查每个拉取请求的代码质量有多现实,以及将这两部分集成的最佳实践是什么.

How realistic is it to configure GitLab with SonarQube for inspecting code quality for every pull request and what will be the best practice to integrate these two piece.

谢谢

推荐答案

你真的不需要插件.在你的 .gitlab-ci.yml

you don't really need a plugin. make something like this in your .gitlab-ci.yml

stages: 
- build 
build_master:
  image: maven
  stage: build
  artifacts:
    paths:
    - target/*.jar
  script:
  - mvn package sonar:sonar -Dsonar.host.url=https://sonar.yourdomain.tld/ 
  only:
  - master

每个主推都将经过测试!(这是针对 Java 项目的……)

and every master push will be tested! (this is for a Java project...)

这篇关于Gitlab 与 SonarQube 的集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆