From 04da130dbd859c54127f896e2f5fa35e14d05a03 Mon Sep 17 00:00:00 2001 From: Christopher Fenner <26137398+CCFenner@users.noreply.github.com> Date: Mon, 11 May 2020 12:46:16 +0200 Subject: [PATCH] fix(sonar): handle piper-bin error result (#1524) --- vars/sonarExecuteScan.groovy | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/vars/sonarExecuteScan.groovy b/vars/sonarExecuteScan.groovy index d33f52348..f87469809 100644 --- a/vars/sonarExecuteScan.groovy +++ b/vars/sonarExecuteScan.groovy @@ -67,14 +67,16 @@ void call(Map parameters = [:]) { dockerOptions: config.dockerOptions ) { if(!fileExists('.git')) utils.unstash('git') - withSonarQubeEnv(stepConfig.instance) { - withCredentials(credentials) { - withEnv(environment){ - sh "./piper ${STEP_NAME}${customDefaultConfig}${customConfigArg}" + piperExecuteBin.handleErrorDetails(STEP_NAME) { + withSonarQubeEnv(stepConfig.instance) { + withCredentials(credentials) { + withEnv(environment){ + sh "./piper ${STEP_NAME}${customDefaultConfig}${customConfigArg}" + } } } + jenkinsUtils.handleStepResults(STEP_NAME, false, false) } - jenkinsUtils.handleStepResults(STEP_NAME, false, false) } } finally { def ignore = sh script: 'rm -rf .sonar-scanner .certificates', returnStatus: true