This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dev:git:sonarqube [2022/04/28 11:54] – js | dev:git:sonarqube [2022/05/09 11:31] (current) – mb | ||
---|---|---|---|
Line 5: | Line 5: | ||
Homepage: [[https:// | Homepage: [[https:// | ||
- | ==== Install Server ==== | ||
- | |||
- | |||
- | ==== Activate in Projekt on GitLab ==== | ||
- | Doc: [[https:// | ||
- | |||
- | - Create Access Token in Gitlab in the Group or Project | ||
- | - Token name: SonarQube | ||
- | - Scopes: api | ||
- | - Expiration date: empty = no | ||
- | - Role: Reporter | ||
- | Save the group access token | ||
- | |||
- | - 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 | ||
- | - file: **.sonar-project.properties** | ||
- | * In root dir of the project. | ||
- | * Filename: sonar-project.properties | ||
- | * Content: < | ||
- | sonar.qualitygate.wait=true | ||
- | sonar.python.version=2 | ||
- | </ | ||
- | - Add two vars to Project: Settings-> | ||
- | - key: SONAR_TOKEN | ||
- | - Value: generate token in SonarQube Webinterface | ||
- | - uncheck " | ||
- | - CHECK "Mask Variable" | ||
- | - key: SONAR_HOST_URL | ||
- | - Value: https:// | ||
- | - Uncheck both: Protect Variable / Mask Variable | ||
- | |||
- | |||
- | - add sonarqube job in .gitlab-ci.yml | ||
- | - < | ||
- | - sonarqube | ||
- | |||
- | |||
- | sonarqube_check_job: | ||
- | only: | ||
- | refs: | ||
- | - tags | ||
- | variables: | ||
- | - $CI_COMMIT_TAG =~ / | ||
- | image: | ||
- | name: sonarsource/ | ||
- | entrypoint: ["" | ||
- | tags: | ||
- | - sonarqube-runner | ||
- | stage: sonarqube | ||
- | variables: | ||
- | SONAR_USER_HOME: | ||
- | GIT_DEPTH: " | ||
- | cache: | ||
- | key: " | ||
- | paths: | ||
- | - .sonar/ | ||
- | script: | ||
- | - sonar-scanner -Dsonar.qualitygate.wait=false -Dproject.settings=.sonar-project.properties | ||
- | </ | ||
+ | * [[dev: | ||
+ | * [[dev: | ||
+ | * [[dev: | ||