48 lines
1.7 KiB
YAML
48 lines
1.7 KiB
YAML
.sonar-template-common:
|
|
stage: verify
|
|
interruptible: true
|
|
variables:
|
|
SONAR_HOST_URL: http://sonar7.exxcellent.de/sonar7
|
|
SONAR_PROJECT_KEY: ""
|
|
SONAR_PROJECT_NAME: ""
|
|
SONAR_EXCLUSIONS: "**/target/**,**/src/test/**,**/generated/**,**/i18n/**"
|
|
SONAR_SKIP_BUILD_BREAKER: "true"
|
|
SONAR_QUERY_MAX_ATTEMPTS_BUILD_BREAKER: "30"
|
|
SONAR_QUERY_INTERVAL_BUILD_BREAKER: "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.exclusions=$SONAR_EXCLUSIONS"
|
|
"-Dsonar.buildbreaker.skip=$SONAR_SKIP_BUILD_BREAKER"
|
|
"-Dsonar.buildbreaker.queryMaxAttempts=$SONAR_QUERY_MAX_ATTEMPTS_BUILD_BREAKER"
|
|
"-Dsonar.buildbreaker.queryInterval=$SONAR_QUERY_INTERVAL_BUILD_BREAKER"
|
|
|
|
.sonar-gradle:
|
|
extends: .sonar-template-common
|
|
image: $GRADLE_IMAGE
|
|
script:
|
|
- >
|
|
if [ "$BACKEND_DIR" != "" ]; then
|
|
cd $BACKEND_DIR
|
|
fi
|
|
- ./gradlew --build-cache $GRADLE_OPTS sonarqube $GRADLE_CLI_OPTS $GRADLE_EXTRA_OPTS
|
|
"-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.buildbreaker.skip=$SONAR_SKIP_BUILD_BREAKER"
|
|
"-Dsonar.buildbreaker.queryMaxAttempts=$SONAR_QUERY_MAX_ATTEMPTS_BUILD_BREAKER"
|
|
"-Dsonar.buildbreaker.queryInterval=$SONAR_QUERY_INTERVAL_BUILD_BREAKER"
|