diff --git a/platform/Jenkinsfile b/platform/Jenkinsfile index 244eefb..25f1522 100644 --- a/platform/Jenkinsfile +++ b/platform/Jenkinsfile @@ -35,15 +35,24 @@ pipeline { stage('SonarQube Analysis') { steps { container('sonar-scanner') { - withSonarQubeEnv('sonarqube') { - script { - def scannerHome = tool 'sonar-scanner' - sh """ - ${scannerHome}/bin/sonar-scanner \ - -Dsonar.projectKey=management-platform \ - -Dsonar.sources=platform \ - -Dsonar.python.version=3 - """ + // Analysis quality, not a deploy gate: SonarQube being + // unreachable (moved server, migration in progress, + // temporary outage) shouldn't block shipping an + // otherwise-good build. catchError marks the build + // UNSTABLE (visible in the UI, doesn't need separate + // watching) and lets the pipeline continue to Deploy + // instead of failing the whole run. + catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { + withSonarQubeEnv('sonarqube') { + script { + def scannerHome = tool 'sonar-scanner' + sh """ + ${scannerHome}/bin/sonar-scanner \ + -Dsonar.projectKey=management-platform \ + -Dsonar.sources=platform \ + -Dsonar.python.version=3 + """ + } } } }