Add config for nonrtric-plt-sme
Issue-ID: NONRTRIC-805
Signed-off-by: elinuxhenrik <henrik.b.andersson@est.tech>
Change-Id: I827307739effa70a3454a3f72705f17b8a1cddf7
diff --git a/jjb/nonrtric-plt-sme/nonrtric-plt-sme.yaml b/jjb/nonrtric-plt-sme/nonrtric-plt-sme.yaml
index 63e389c..d4164df 100644
--- a/jjb/nonrtric-plt-sme/nonrtric-plt-sme.yaml
+++ b/jjb/nonrtric-plt-sme/nonrtric-plt-sme.yaml
@@ -12,4 +12,60 @@
build-node: centos7-builder-1c-1g
branch: master
jobs:
- - gerrit-info-yaml-verify
\ No newline at end of file
+ - gerrit-info-yaml-verify
+
+- sme_common: &sme_common
+ name: sme-common
+ # git repo
+ project: nonrtric/plt/sme
+ # jenkins job name prefix
+ project-name: nonrtric-plt-sme
+ # maven settings file has docker credentials
+ mvn-settings: nonrtric-plt-sme-settings
+
+- project:
+ <<: *sme_common
+ name: nonrtric-plt-sme-release
+ # maven release requires sigul which requires centos
+ # container release requires docker
+ build-node: centos7-docker-2c-8g
+ jobs:
+ - '{project-name}-gerrit-release-jobs'
+
+- project:
+ <<: *sme_common
+ name: nonrtric-plt-sme
+ project-name: '{name}'
+ # image name
+ docker-name: 'o-ran-sc/nonrtric-plt-sme'
+ # 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: '.'
+ # Directory where go test should be run
+ go-root: '.'
+ 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:
+ <<: *sme_common
+ name: nonrtric-plt-sme-sonar
+ project-name: nonrtric-plt-sme
+ # prescan script requires ubuntu
+ # golang is only on docker-enabled nodes
+ build-node: ubuntu1804-docker-4c-4g
+ sonar-prescan-script: !include-raw-escape: prescan-sme-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
diff --git a/jjb/nonrtric-plt-sme/prescan-sme-ubuntu.sh b/jjb/nonrtric-plt-sme/prescan-sme-ubuntu.sh
new file mode 100644
index 0000000..3e1db20
--- /dev/null
+++ b/jjb/nonrtric-plt-sme/prescan-sme-ubuntu.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+##############################################################################
+#
+# Copyright (C) 2022: 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-sme-ubuntu.sh"
+
+set -ex
+
+# Assumes ubuntu - uses apt-get
+sudo apt-get update
+
+# build script execution
+bash ./build-sme-ubuntu.sh
+
+echo "--> prescan-sme-ubuntu.sh ends"
diff --git a/jjb/nonrtric-plt-sme/sonar-project.properties b/jjb/nonrtric-plt-sme/sonar-project.properties
new file mode 100644
index 0000000..bb3a453
--- /dev/null
+++ b/jjb/nonrtric-plt-sme/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=coverage.txt
+# Inclusions
+sonar.inclusions=main.go,internal/**/**.go
+# Exclusions
+sonar.exclusions=main_test.go,internal/,internal/**/*_test.go,internal/**/*.gen.go,internal/**/mocks/**