.sonar-template-common: stage: verify variables: SONAR_HOST_URL: https://sonar.exxcellent.de/sonar8 SONAR_PROJECT_KEY: "" SONAR_PROJECT_NAME: "" SONAR_EXCLUSIONS: "**/target/**,**/build/**,**/src/test/**" SONAR_QUALITYGATE_WAIT: "true" SONAR_QUALITYGATE_TIMEOUT: "10000" .sonar-maven: extends: .sonar-template-common image: $MAVEN_IMAGE script: - > if [ "$BACKEND_DIR" != "" ]; then cd $BACKEND_DIR fi - mvn $MAVEN_CLI_OPTS test sonar:sonar $MVN_EXTRA_ARGS "-Dsonar.host.url=$SONAR_HOST_URL" "-Dsonar.login=$SONAR_TOKEN" "-Dsonar.projectKey=$SONAR_PROJECT_KEY" "-Dsonar.projectName=$SONAR_PROJECT_NAME" "-Dsonar.projectDescription=$CI_PROJECT_DESCRIPTION" "-Dsonar.projectVersion=$CI_COMMIT_SHORT_SHA" "-Dsonar.exclusions=$SONAR_EXCLUSIONS" "-Dsonar.qualitygate.wait=$SONAR_QUALITYGATE_WAIT" "-Dsonar.qualitygate.timeout=$SONAR_QUALITYGATE_TIMEOUT" "-Dsonar.links.scm=$CI_PROJECT_URL" .sonar-gradle: extends: .sonar-template-common image: $GRADLE_IMAGE script: - > if [ "$BACKEND_DIR" != "" ]; then cd $BACKEND_DIR fi - ./gradlew $GRADLE_OPTS sonarqube $GRADLE_CLI_OPTS "-Dsonar.host.url=$SONAR_HOST_URL" "-Dsonar.login=$SONAR_TOKEN" "-Dsonar.projectKey=$SONAR_PROJECT_KEY" "-Dsonar.projectName=$SONAR_PROJECT_NAME" "-Dsonar.projectDescription=$CI_PROJECT_DESCRIPTION" "-Dsonar.projectVersion=$CI_COMMIT_SHORT_SHA" "-Dsonar.exclusions=$SONAR_EXCLUSIONS" "-Dsonar.qualitygate.wait=$SONAR_QUALITYGATE_WAIT" "-Dsonar.qualitygate.timeout=$SONAR_QUALITYGATE_TIMEOUT" "-Dsonar.links.scm=$CI_PROJECT_URL"