Fix: bug in shell script maven-sonar.sh 97/69097/1 v0.69.1
authorKevin Sandi <ksandi@contractor.linuxfoundation.org>
Tue, 9 Nov 2021 23:23:04 +0000 (17:23 -0600)
committerKevin Sandi <ksandi@contractor.linuxfoundation.org>
Tue, 9 Nov 2021 23:23:04 +0000 (17:23 -0600)
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 <ksandi@contractor.linuxfoundation.org>
Change-Id: I6aa16ef65ded5c35174003439f7d183cfa8d0fcf

releasenotes/notes/fix-shell-script-maven-sonar-ed2dfaafcc10bbbb.yaml [new file with mode: 0644]
shell/maven-sonar.sh

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 (file)
index 0000000..ce0ee67
--- /dev/null
@@ -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
index 9af6e42..5b460c5 100644 (file)
@@ -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