From 7c9c0dc30b22dfdcf9ebd6fbe3e18db62ef7c672 Mon Sep 17 00:00:00 2001 From: PatrikBuhr Date: Fri, 18 Mar 2022 09:16:12 +0100 Subject: [PATCH] NONRTRIC - Sonar support Change-Id: I41afa17af87ad739a5b22131073198ecda6c420e Signed-off-by: PatrikBuhr Issue-ID: NONRTRIC-737 --- jjb/nonrtric/nonrtric.yaml | 44 ++++++++++++++++++++++ .../prescan-nonrtric-auth-token-fetch-ubuntu.sh | 30 +++++++++++++++ jjb/nonrtric/sonar-project.properties | 6 +-- 3 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 jjb/nonrtric/prescan-nonrtric-auth-token-fetch-ubuntu.sh diff --git a/jjb/nonrtric/nonrtric.yaml b/jjb/nonrtric/nonrtric.yaml index 55c2ab68..cf574ffd 100644 --- a/jjb/nonrtric/nonrtric.yaml +++ b/jjb/nonrtric/nonrtric.yaml @@ -160,6 +160,50 @@ - dawn: branch: dawn +- project: + <<: *nonrtric_jdk_common + name: nonrtric-auth-token-fetch + project-name: '{name}' + # image name + docker-name: 'o-ran-sc/nonrtric-auth-token-fetch' + # get tag from YAML + container-tag-method: yaml-file + # use host network to clone from our gerrit + docker-build-args: '--network=host' + # Directory with Dockerfile + docker-root: 'auth-token-fetch' + # use host network to clone from our gerrit + docker-build-args: '--network=host' + # Directory where go test should be run + go-root: 'auth-token-fetch' + # Limit build trigger to appropriate files + gerrit_trigger_file_paths: + - compare-type: REG_EXP + pattern: 'auth-token-fetch/.*' + build-node: ubuntu1804-docker-4c-4g + # Includes verify and merge jobs + jobs: + - "{project-name}-gerrit-docker-jobs" + - gerrit-go-verify + stream: + - master: + branch: master + +- project: + <<: *nonrtric_jdk_common + name: nonrtric-auth-token-fetch-sonar + project-name: nonrtric-auth-token-fetch + # prescan script requires ubuntu + # golang is only on docker-enabled nodes + build-node: ubuntu1804-docker-4c-4g + sonar-prescan-script: !include-raw-escape: prescan-nonrtric-auth-token-fetch-ubuntu.sh + sonar-project-file: "" + java-version: openjdk11 + # use sonarcloud values from defaults.yaml + sonar-properties: !include-raw: sonar-project.properties + jobs: + - gerrit-sonar-prescan-script + - project: <<: *nonrtric_jdk_common name: nonrtric-release diff --git a/jjb/nonrtric/prescan-nonrtric-auth-token-fetch-ubuntu.sh b/jjb/nonrtric/prescan-nonrtric-auth-token-fetch-ubuntu.sh new file mode 100644 index 00000000..b5f282b5 --- /dev/null +++ b/jjb/nonrtric/prescan-nonrtric-auth-token-fetch-ubuntu.sh @@ -0,0 +1,30 @@ +#!/bin/sh +############################################################################## +# +# Copyright (C) 2021: 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 "--> $0" + +set -ex + +# Assumes ubuntu - uses apt-get +sudo apt-get update + +# build script execution +bash auth-token-fetch/run-tests-ubuntu.sh + +echo "--> $0 ends" diff --git a/jjb/nonrtric/sonar-project.properties b/jjb/nonrtric/sonar-project.properties index 4b499ffa..36f8b511 100644 --- a/jjb/nonrtric/sonar-project.properties +++ b/jjb/nonrtric/sonar-project.properties @@ -9,8 +9,8 @@ sonar.language=go # Source sonar.sources=. # Unit tests -sonar.go.coverage.reportPaths=dmaap-mediator-producer/coverage.txt +sonar.go.coverage.reportPaths=auth-token-fetch/coverage.txt # Inclusions -sonar.inclusions=dmaap-mediator-producer/internal/**/**.go +sonar.inclusions=auth-token-fetch/**.go # Exclusions -sonar.exclusions=dmaap-mediator-producer/main.go,dmaap-mediator-producer/mocks/**.go,dmaap-mediator-producer/stub/**.go,dmaap-mediator-producer/internal/**/**_test.go +sonar.exclusions=auth-token-fetch/**_test.go -- 2.16.6