|
|
### Prerequisites
|
|
### Prerequisites
|
|
|
I installed Gitlab, Gitlab runners and Sonarqube on docker containers on Ubuntu 16.04 server on VirtualBox. I used Docker Compose for Sonarqube and Gitlab and Docker for Gitlab runners. Guides how to install docker, docker-compose and Gitlab are [here](Gitlab_compose container_guide). Guide to how to install sonarqube on docker-compose is on [here](Gitlab devops).
|
|
I installed Gitlab, Gitlab runners and Sonarqube on docker containers on Ubuntu 16.04 server on VirtualBox. I used Docker Compose for Sonarqube and Gitlab and Docker for Gitlab runners. Guides how to install docker, docker-compose and Gitlab are [here](Gitlab_compose container_guide). Guide to how to install sonarqube on docker-compose is on [here](Gitlab devops).
|
|
|
|
|
|
|
|
|
### Sonarqube Gitlab plugin
|
|
|
|
I used Sonarqube Gitlab plugin to integrate Sonarqube to Gitlab. This quide is based on [this](https://gitlab.talanlabs.com/gabriel-allaigre/sonar-gitlab-plugin) project. I downloaded version [2.1.0](https://github.com/gabrie-allaigre/sonar-gitlab-plugin/releases/download/2.1.0/sonar-gitlab-plugin-2.1.0.jar) because my Sonarqube is version 6.7.4. You can download plugin for the link or in the project page. You need to unzip the plugin files to `SONARQUBE_HOME/extensions/plugins` directory. You need to also restart Sonarqube after that.
|
|
|
|
|
|
|
|
### Configuring Sonarqube
|
|
|
|
In Sonarqube go to Administrator > Configuration > General Settings > Gitlab and set the Gitlab url, User token and API version.
|
|
|
|

|
|
|
|
|
|
|
|
You can create GitLab API token by following the previous quide [Gitlab+Jenkins+Sonarqube](Gitlab devops). Then go to the project settings you are planning to use with the GitLab. Go to Administrator > Projects > Projects Management and select the project or create a new project.
|
|
|
|

|
|
|
|
|
|
|
|
You need to set the Gitlab project id which can be found by exploring your GitLab project settings:
|
|
|
|

|
|
|
|
|
|
|
|
Now your Sonarqube configuration is ready.
|
|
|
|
|
|
|
|
### Setting up Gitlab project for Sonarqube
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|