| ... | @@ -18,6 +18,29 @@ Now your Sonarqube configuration is ready. |
... | @@ -18,6 +18,29 @@ Now your Sonarqube configuration is ready. |
|
|
|
|
|
|
|
### Setting up Gitlab project for Sonarqube
|
|
### Setting up Gitlab project for Sonarqube
|
|
|
|
|
|
|
|
|
You have to create GitLab runners if you want to use Gitlab for CI/CD.
|
|
|
|
|
|
|
|
#### Setting up Gitlab runners
|
|
|
|
I used docker container for this. I used GitLab [official guides](https://docs.gitlab.com/runner/install/docker.html) for this. Creating a runner container:
|
|
|
|
```
|
|
|
|
docker run -d --name gitlab-runner --restart always \
|
|
|
|
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
|
|
|
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
|
|
|
gitlab/gitlab-runner:latest
|
|
|
|
```
|
|
|
|
After creating the container we need to set a runner for the project. Go inside to the gitlab-runners container:
|
|
|
|
```
|
|
|
|
sudo docker exec -it gitlab-runners /bin/bash
|
|
|
|
```
|
|
|
|
```
|
|
|
|
gitlab-runner register
|
|
|
|
```
|
|
|
|
Then you need to set the project specific token and the GitLab url. These can be found in GitLab Admin Area > Runners:
|
|
|
|

|
|
|
|
Copy the token to setup the runner.
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|