Closed elboletaire closed 6 years ago
Nor the sonar scanner, nor the gitlab plugin for sonar, support crashing the scan in case a quality profile fails, but we can use the sonar api to fix that.
See https://docs.sonarqube.org/display/SONARQUBE54/Breaking+the+CI+Build for more details about how to break the build, but basically we should:
QUALITY_CHECK
ceTaskId
report-task.txt
${SONAR_URL}/api/ce/task?id=${ceTaskId}
analysisId
${SONAR_URL}api/qualitygates/project_status?analysisId=${analysisId}
status
OK
Apparently, quality gates are currently crashing our builds in sonarqube > 7.0, so this is not needed anymore.
Nor the sonar scanner, nor the gitlab plugin for sonar, support crashing the scan in case a quality profile fails, but we can use the sonar api to fix that.
See https://docs.sonarqube.org/display/SONARQUBE54/Breaking+the+CI+Build for more details about how to break the build, but basically we should:
QUALITY_CHECK
is defined.ceTaskId
from the generated file by sonarreport-task.txt
.${SONAR_URL}/api/ce/task?id=${ceTaskId}
and getanalysisId
field${SONAR_URL}api/qualitygates/project_status?analysisId=${analysisId}
and getanalysisId
fieldstatus
!==OK
, break the build.