Breaks the build if the SonarQube quality gate of the project is red.
- Maven plugin - You can use this to run it in your Maven build.
- CLI - You can use this to run it in your CI pipeline as standalone application.
- Library - A library which provides the building blocks. You only need this if you want to develop your own build breaker.
Put this line directly after the SonarQube analysis:
mvn --batch-mode --update-snapshots --non-recursive de.qaware.tools.sonarqube-build-breaker:sqbb-maven-plugin:sqbb -Dsqbb.sonarQubeUrl=$SONAR_URL -Dsqbb.sonarQubeToken=$SONAR_TOKEN -Dsqbb.branch=$CI_BUILD_REF_NAME
This line will automatically download the newest SonarQube build breaker and run it.
The build breaker needs two environment variables set:
SONAR_TOKEN
SONAR_URL
These can be configured in the CI/CD settings in the GitLab project configuration.
Licensed under MIT, Copyright (c) 2019 QAware GmbH
Moritz Kammerer ([email protected] | @phxql)