From cfc5efacbf610858add8e54cf806719e99940fa2 Mon Sep 17 00:00:00 2001 From: Kevin Sandi Date: Tue, 9 Nov 2021 17:23:04 -0600 Subject: [PATCH] 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 --- .../notes/fix-shell-script-maven-sonar-ed2dfaafcc10bbbb.yaml | 5 +++++ shell/maven-sonar.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-shell-script-maven-sonar-ed2dfaafcc10bbbb.yaml 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 -- 2.16.6