From 2f5b771908ac3c9d392eb57c14b26913ab60baf9 Mon Sep 17 00:00:00 2001 From: Timo Beller Date: Thu, 20 Jan 2022 10:49:27 +0100 Subject: [PATCH] feat(tool-sonar): activates Build-Breaker (by default) and make properties configurable --- documentation/chapters/templates/tool-sonar7.adoc | 2 ++ tool-sonar7.gitlab-ci.yml | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/documentation/chapters/templates/tool-sonar7.adoc b/documentation/chapters/templates/tool-sonar7.adoc index 933f251..080ceb9 100644 --- a/documentation/chapters/templates/tool-sonar7.adoc +++ b/documentation/chapters/templates/tool-sonar7.adoc @@ -15,6 +15,8 @@ Mehr Details zu finden hier: https://gitlab.exxcellent.de/gilden/ci/exxcellent-s (Es wird dann standardmäßig der Maven project.name verwendet) |SONAR_EXCLUSIONS | Files die Sonar ausgeschlossen werden |"**/target/**,**/src/test/**" |SONAR_SKIP_BUILD_BREAKER | Definiert ob der Build Breaker übersprungen werden soll | "true" +|SONAR_BUILDBREAKER_QUERYMAXATTEMPTS | Maximale Anzahl an Anfragen, um den Sonar-Report zu erhalten | "30" +|SONAR_BUILDBREAKER_QUERYINTERVAL | Intervallzeit in Millisekunden zwischen 2 Anfragen | "10000" |=== diff --git a/tool-sonar7.gitlab-ci.yml b/tool-sonar7.gitlab-ci.yml index ff23d38..59967bc 100644 --- a/tool-sonar7.gitlab-ci.yml +++ b/tool-sonar7.gitlab-ci.yml @@ -7,6 +7,8 @@ SONAR_PROJECT_NAME: "" SONAR_EXCLUSIONS: "**/target/**,**/src/test/**" SONAR_SKIP_BUILD_BREAKER: "true" + SONAR_BUILDBREAKER_QUERYMAXATTEMPTS: "30" + SONAR_BUILDBREAKER_QUERYINTERVAL: "10000" script: - mvn $MAVEN_CLI_OPTS test sonar:sonar "-Dsonar.host.url=$SONAR_HOST_URL" @@ -15,15 +17,20 @@ "-Dsonar.projectName=$SONAR_PROJECT_NAME" "-Dsonar.exclusions=$SONAR_EXCLUSIONS" "-Dsonar.buildbreaker.skip=$SONAR_SKIP_BUILDBREAKER" + "-Dsonar.buildbreaker.queryMaxAttempts=${SONAR_BUILDBREAKER_QUERYMAXATTEMPTS}" + "-Dsonar.buildbreaker.queryInterval=${SONAR_BUILDBREAKER_QUERYINTERVAL}" .sonar-template-gradle: stage: test - image: gitlab.exxcellent.de:4567/gilden/ci/exxcellent-sonar-tool:latest + image: $GRADLE_IMAGE variables: SONAR_HOST_URL: http://sonar7.exxcellent.de/sonar7 SONAR_PROJECT_KEY: "" SONAR_PROJECT_NAME: "" SONAR_EXCLUSIONS: "**/target/**,**/src/test/**" + SONAR_SKIP_BUILD_BREAKER: "false" + SONAR_BUILDBREAKER_QUERYMAXATTEMPTS: "30" + SONAR_BUILDBREAKER_QUERYINTERVAL: "10000" script: - ./gradlew $GRADLE_OPTS sonarqube "-Dsonar.host.url=$SONAR_HOST_URL" @@ -32,3 +39,6 @@ "-Dsonar.projectName=$SONAR_PROJECT_NAME" "-Dsonar.exclusions=$SONAR_EXCLUSIONS" "-Dsonar.buildbreaker.skip=$SONAR_SKIP_BUILDBREAKER" + "-Dsonar.buildbreaker.queryMaxAttempts=${SONAR_BUILDBREAKER_QUERYMAXATTEMPTS}" + "-Dsonar.buildbreaker.queryInterval=${SONAR_BUILDBREAKER_QUERYINTERVAL}" +