SonarQube build breaker
Breaks the build if the SonarQube quality gate of the project is red.
See the blog post I wrote for more details.
- 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.
Recommended usage in the GitLab pipeline
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:
These can be configured in the CI/CD settings in the GitLab project configuration.
See this document.
Licensed under MIT, Copyright (c) 2019 - 2020 QAware GmbH