From: Kevin Sandi Date: Tue, 9 Nov 2021 23:23:04 +0000 (-0600) Subject: Fix: bug in shell script maven-sonar.sh X-Git-Tag: v0.69.1^0 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F97%2F69097%2F1;p=releng%2Fglobal-jjb.git Fix: bug in shell script maven-sonar.sh In order to fix a bug in maven-sonar.sh we should treat parameter scan-dev-branch as string instead of boolean Issue-ID: RELENG-4011 Signed-off-by: Kevin Sandi Change-Id: I6aa16ef65ded5c35174003439f7d183cfa8d0fcf --- diff --git a/releasenotes/notes/fix-shell-script-maven-sonar-ed2dfaafcc10bbbb.yaml b/releasenotes/notes/fix-shell-script-maven-sonar-ed2dfaafcc10bbbb.yaml new file mode 100644 index 00000000..ce0ee67f --- /dev/null +++ b/releasenotes/notes/fix-shell-script-maven-sonar-ed2dfaafcc10bbbb.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fix shell script maven-sonar.sh to handle parameter $SCAN_DEV_BRANCH + as string and not as boolean, so we can achieve the desired IF logic diff --git a/shell/maven-sonar.sh b/shell/maven-sonar.sh index 9af6e427..5b460c51 100644 --- a/shell/maven-sonar.sh +++ b/shell/maven-sonar.sh @@ -34,7 +34,7 @@ if [ "$SONAR_HOST_URL" = "https://sonarcloud.io" ]; then params+=("-Dsonar.projectKey=$PROJECT_KEY") params+=("-Dsonar.organization=$PROJECT_ORGANIZATION") params+=("-Dsonar.login=$API_TOKEN") - if $SCAN_DEV_BRANCH; then + if [ "$SCAN_DEV_BRANCH" = "True" ]; then echo "Will scan short lived branch ..." # shellcheck disable=SC2236 if [ ! -z ${GERRIT_CHANGE_NUMBER+x} ]; then