gilde-ci-cd/templates/static-analysis/sonar-8.gitlab-ci.yml
2022-07-08 09:55:43 +02:00

36 lines
1.2 KiB
YAML

.sonar-template-common:
stage: verify
variables:
SONAR_HOST_URL: https://sonar.exxcellent.de/sonar8
SONAR_PROJECT_KEY: ""
SONAR_PROJECT_NAME: ""
SONAR_EXCLUSIONS: "**/target/**,**/src/test/**"
SONAR_QUALITYGATE_WAIT: "true"
SONAR_QUALITYGATE_TIMEOUT: "10000"
.sonar-maven:
extends: .sonar-template-common
image: $MAVEN_IMAGE
script:
- mvn $MAVEN_CLI_OPTS test sonar:sonar
"-Dsonar.host.url=$SONAR_HOST_URL"
"-Dsonar.login=$SONAR_TOKEN"
"-Dsonar.projectKey=$SONAR_PROJECT_KEY"
"-Dsonar.projectName=$SONAR_PROJECT_NAME"
"-Dsonar.exclusions=$SONAR_EXCLUSIONS"
"-Dsonar.qualitygate.wait=$SONAR_QUALITYGATE_WAIT"
"-Dsonar.qualitygate.timeout=$SONAR_QUALITYGATE_TIMEOUT"
.sonar-gradle:
extends: .sonar-template-common
image: $GRADLE_IMAGE
script:
- ./gradlew $GRADLE_OPTS $GRADLE_CLI_OPTS sonarqube
"-Dsonar.host.url=$SONAR_HOST_URL"
"-Dsonar.login=$SONAR_TOKEN"
"-Dsonar.projectKey=$SONAR_PROJECT_KEY"
"-Dsonar.projectName=$SONAR_PROJECT_NAME"
"-Dsonar.exclusions=$SONAR_EXCLUSIONS"
"-Dsonar.qualitygate.wait=$SONAR_QUALITYGATE_WAIT"
"-Dsonar.qualitygate.timeout=$SONAR_QUALITYGATE_TIMEOUT"