Gitlab与SonarQube的集成 [英] Gitlab integration with SonarQube
问题描述
对于开发社区,特别是对于DevOps实践,我还很陌生,作为我们试图将SonarQube与Gitlab集成的项目的一部分,我做了一些R& D在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屋!