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 Sona
I was into same requirement and here is how I implemented,
Create a runner without specifying any tags and of shared type.
Create a file .gitlab-ci.yml
file with the following commands,
variables:
SONAR_URL: "http://your_sonar_url"
SONAR_LOGIN: "sonar_user_id"
SONAR_PASSWORD: "sonar_password"
sonarqube_master_job:
stage: test
only:
- master
image: maven:3.3.9-jdk-8-alpine
script:
- mvn --batch-mode verify sonar:sonar -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN -Dsonar.password=$SONAR_PASSWORD
If you create runner with specific tags, then you need to mention the tags in the .gitlab-ci.yml
file
you can get more information on adding tags in this link, https://forum.gitlab.com/t/activated-specific-runner-is-not-working/7002