Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in DevOps and Agile by (29.3k points)

I am pretty new to the Developement community and specifically to DevOps practices, as a part of the project we are trying to integrate SonarQube with Gitlab, did some R& D on SonarQube and Git CI ( Continuous Integration ) and look like the plugin is released for Github and SonarQube whereas not for 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 pieces.

Thanks

1 Answer

0 votes
by (50.2k points)

In .gitlab-ci.yml make changes as per the code 

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

This will help for the java project if you required to see the plugins go through

https://gitlab.talanlabs.com/gabriel-allaigre/sonar-gitlab-plugin.git

https://git.johnnei.org/Johnnei/sonar-gitlab-plugin.git

These are the sonar Qube plugins through which you can easily integrate into gitlab.

Also, if you want to learn more about DevOps, you can enroll in DevOps Training.

Related questions

0 votes
1 answer
asked Oct 5, 2019 in DevOps and Agile by Abhishek_31 (12.8k points)
0 votes
1 answer
0 votes
1 answer
asked Apr 20 in DevOps and Agile by dev_sk2311 (43.2k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.2k users

Browse Categories

...