Enabling SONAR - Added Jobs for RANPM 91/11591/2
authorambrishest <ambrish.singh@est.tech>
Wed, 9 Aug 2023 12:59:29 +0000 (13:59 +0100)
committerambrishest <ambrish.singh@est.tech>
Wed, 9 Aug 2023 15:47:32 +0000 (16:47 +0100)
Issue-ID: NONRTRIC-879
Change-Id: If8da3f6d39a2fc6c05f16bdebbf667a1cae325b3
Signed-off-by: ambrishest <ambrish.singh@est.tech>
jjb/nonrtric-plt-ranpm/nonrtric-plt-ranpm.yaml
jjb/nonrtric-plt-ranpm/prescan-pm-file-converter-ubuntu.sh [new file with mode: 0644]
jjb/nonrtric-plt-ranpm/sonar-project.properties [new file with mode: 0644]

index 5fb7a80..ec1e4c6 100644 (file)
           branch: master
       - h-release:
           branch: h-release
+
+# Jobs for nonrtric-plt-ranpm-pm-file-converter SONAR
+- project:
+    <<: *nonrtric_plt_ranpm_jdk_common
+    name: nonrtric-plt-ranpm-pm-file-converter-sonar
+    # prescan script requires ubuntu
+    # golang is only on docker-enabled nodes
+    build-node: ubuntu1804-docker-4c-4g
+    gerrit_trigger_file_paths:
+      - compare-type: REG_EXP
+        pattern: "pm-file-converter/.*"
+    sonar-prescan-script: !include-raw-escape: prescan-pm-file-converter-ubuntu.sh
+    sonar-project-file: ""
+    java-version: openjdk11
+    # use sonarcloud values from defaults.yaml
+    sonar-properties: !include-raw-escape: sonar-project.properties
+    jobs:
+      - gerrit-sonar-prescan-script
diff --git a/jjb/nonrtric-plt-ranpm/prescan-pm-file-converter-ubuntu.sh b/jjb/nonrtric-plt-ranpm/prescan-pm-file-converter-ubuntu.sh
new file mode 100644 (file)
index 0000000..6bd2a21
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+##############################################################################
+#
+#   Copyright (C) 2023: Nordix Foundation
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+##############################################################################
+
+echo "--> prescan-pm-file-converter-ubuntu.sh"
+
+set -ex
+
+# Assumes ubuntu - uses apt-get
+sudo apt-get update
+
+# build script execution
+bash pm-file-converter/build-pm-file-converter-ubuntu.sh
+
+echo "--> prescan-pm-file-converter-ubuntu.sh ends"
+
diff --git a/jjb/nonrtric-plt-ranpm/sonar-project.properties b/jjb/nonrtric-plt-ranpm/sonar-project.properties
new file mode 100644 (file)
index 0000000..51c4d68
--- /dev/null
@@ -0,0 +1,16 @@
+# Required metadata\r
+sonar.login={sonarcloud_api_token}\r
+sonar.projectKey={sonarcloud_project_organization}_{project-name}\r
+sonar.organization={sonarcloud_project_organization}\r
+# Encoding\r
+sonar.build.sourceEncoding=UTF-8\r
+# Language\r
+sonar.language=go\r
+# Source\r
+sonar.sources=.\r
+# Unit tests\r
+sonar.go.coverage.reportPaths=pm-file-converter/coverage.txt\r
+# Inclusions\r
+sonar.inclusions=pm-file-converter/main.go,pm-file-converter/common/**/**.go,pm-file-converter/components/**/**.go\r
+# Exclusions (TODO)\r
+sonar.exclusions=pm-file-converter/components/xmltransform/xmltransform_test.go\r