Add Gitlab Project to SonarQube
Activate in Projekt on GitLab
Import GitLab Project into SonarQube
Add Projekt
Enter group access token
Select Project you want to add
Choose “With GitLab CI” for analyze your repository
Project key: Other
add file: .sonar-project.properties
Add two vars to Project: Settings→ CI/CD → Variables
key: SONAR_TOKEN
Value: generate token in SonarQube Webinterface
uncheck “Protect Variable”
CHECK “Mask Variable”
-
-
Uncheck both: Protect Variable / Mask Variable
enable shared runners in Settings → CI/CD

add .sonar-wrapper script to project in root dir
We use the .sonar-wrapper script in the project main branch to configure files without extensions
add sonarqube job in .gitlab-ci.yml
stages:
- sonarqube
include:
- remote: 'https://gitsrv.schnuerle.com:8443/sonar/sonar-wrapper/-/raw/main/sonar-gitlab-ci.yml'
Authors: