Skip to content

Commit

Permalink
fix(sonar): allign groovy part of Sonar step with common piperExecute…
Browse files Browse the repository at this point in the history
…Bin (#5157)

* add some logging to Vault login

* allign groovy part of the sonar step

* Revert "add some logging to Vault login"

This reverts commit d1738c1.
  • Loading branch information
Googlom authored Oct 24, 2024
1 parent 7b7ba77 commit 4990b2d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions vars/sonarExecuteScan.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,19 @@ void call(Map parameters = [:]) {
writePipelineEnv(script: script, piperGoPath: piperGoPath)
withEnv(environment) {
influxWrapper(script) {
piperExecuteBin.credentialWrapper(config, credentialInfo) {
if (stepConfig.instance) {
withSonarQubeEnv(stepConfig.instance) {
echo "Instance is deprecated - please use serverUrl parameter to set URL to the Sonar backend."
try {
piperExecuteBin.credentialWrapper(config, credentialInfo) {
if (stepConfig.instance) {
withSonarQubeEnv(stepConfig.instance) {
echo "Instance is deprecated - please use serverUrl parameter to set URL to the Sonar backend."
sh "${piperGoPath} ${STEP_NAME}${customDefaultConfig}${customConfigArg}"
}
} else {
sh "${piperGoPath} ${STEP_NAME}${customDefaultConfig}${customConfigArg}"
jenkinsUtils.handleStepResults(STEP_NAME, false, false)
readPipelineEnv(script: script, piperGoPath: piperGoPath)
}
} else {
sh "${piperGoPath} ${STEP_NAME}${customDefaultConfig}${customConfigArg}"
}
} finally {
jenkinsUtils.handleStepResults(STEP_NAME, false, false)
}
}
}
Expand Down

0 comments on commit 4990b2d

Please sign in to comment.