diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6d43228d71717a950fbc054118c6707cdec8ae2e..2136884d61abb9493275998623b6148d6b46b4e0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,7 +27,7 @@ verify: stage: verify script: - mvn $MAVEN_CLI_OPTS verify site - - mvn $MAVEN_CLI_OPTS sonar:sonar + - test -z "$SONAR_TOKEN" || mvn $MAVEN_CLI_OPTS sonar:sonar -Dsonar.login=${SONAR_TOKEN} -Dsonar.branch.name=${CI_COMMIT_REF_NAME} -Dsonar.projectKey="$SONAR_PROJECT_KEY" @@ -40,6 +40,15 @@ verify: junit: - target/surefire-reports/*.xml +verify:warning: + stage: verify + script: + - echo "Please, configure SonarQube!" + - exit 1 + allow_failure: true + rules: + - if: $SONAR_TOKEN == null + # Convert and import in GitLab coverage data. # The information is then available directly in merge-request view. # Cf. https://docs.gitlab.com/ee/user/project/merge_requests/test_coverage_visualization.html