From c46bfa0b1a490006a53fde49610c8f909d1e1d4f Mon Sep 17 00:00:00 2001 From: ambrishest Date: Wed, 9 Aug 2023 13:59:29 +0100 Subject: [PATCH] Enabling SONAR - Added Jobs for RANPM Issue-ID: NONRTRIC-879 Change-Id: If8da3f6d39a2fc6c05f16bdebbf667a1cae325b3 Signed-off-by: ambrishest --- jjb/nonrtric-plt-ranpm/nonrtric-plt-ranpm.yaml | 18 +++++++++++++ .../prescan-pm-file-converter-ubuntu.sh | 31 ++++++++++++++++++++++ jjb/nonrtric-plt-ranpm/sonar-project.properties | 16 +++++++++++ 3 files changed, 65 insertions(+) create mode 100644 jjb/nonrtric-plt-ranpm/prescan-pm-file-converter-ubuntu.sh create mode 100644 jjb/nonrtric-plt-ranpm/sonar-project.properties diff --git a/jjb/nonrtric-plt-ranpm/nonrtric-plt-ranpm.yaml b/jjb/nonrtric-plt-ranpm/nonrtric-plt-ranpm.yaml index 5fb7a805..ec1e4c62 100644 --- a/jjb/nonrtric-plt-ranpm/nonrtric-plt-ranpm.yaml +++ b/jjb/nonrtric-plt-ranpm/nonrtric-plt-ranpm.yaml @@ -128,3 +128,21 @@ 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 index 00000000..6bd2a21e --- /dev/null +++ b/jjb/nonrtric-plt-ranpm/prescan-pm-file-converter-ubuntu.sh @@ -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 index 00000000..51c4d68b --- /dev/null +++ b/jjb/nonrtric-plt-ranpm/sonar-project.properties @@ -0,0 +1,16 @@ +# Required metadata +sonar.login={sonarcloud_api_token} +sonar.projectKey={sonarcloud_project_organization}_{project-name} +sonar.organization={sonarcloud_project_organization} +# Encoding +sonar.build.sourceEncoding=UTF-8 +# Language +sonar.language=go +# Source +sonar.sources=. +# Unit tests +sonar.go.coverage.reportPaths=pm-file-converter/coverage.txt +# Inclusions +sonar.inclusions=pm-file-converter/main.go,pm-file-converter/common/**/**.go,pm-file-converter/components/**/**.go +# Exclusions (TODO) +sonar.exclusions=pm-file-converter/components/xmltransform/xmltransform_test.go -- 2.16.6