From: Lott, Christopher (cl778h) Date: Wed, 25 Mar 2020 13:20:01 +0000 (-0400) Subject: Add CMake jobs for xapp-frame-cpp repo X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=95cc0897e3ee30c58d2f8ea099d6e8ba68e8bc0f;p=ci-management.git Add CMake jobs for xapp-frame-cpp repo New shell scripts to download and install RMR version 3 with headers on Debian and CentOS distros Signed-off-by: Lott, Christopher (cl778h) Change-Id: I271251e909c6b972680a29a199103933c8add307 --- diff --git a/jjb/ric-plt-xapp-frame-cpp/ric-plt-xapp-frame-cpp.yaml b/jjb/ric-plt-xapp-frame-cpp/ric-plt-xapp-frame-cpp.yaml index 84336e39..f28f5156 100644 --- a/jjb/ric-plt-xapp-frame-cpp/ric-plt-xapp-frame-cpp.yaml +++ b/jjb/ric-plt-xapp-frame-cpp/ric-plt-xapp-frame-cpp.yaml @@ -1,4 +1,10 @@ --- +- project: + name: ric-plt-xapp-frame-cpp-project-view + project-name: ric-plt-xapp-frame-cpp + views: + - project-view + - project: name: ric-plt-xapp-frame-cpp-info project: ric-plt/xapp-frame-cpp @@ -6,3 +12,49 @@ build-node: centos7-builder-1c-1g jobs: - gerrit-info-yaml-verify + +- xapp_frame_cpp_common: &xapp_frame_cpp_common + name: xapp-frame-cpp-common + # git repo + project: ric-plt/xapp-frame-cpp + # jenkins job name prefix + project-name: ric-plt-xapp-frame-cpp + # maven settings file has credentials to archive artifacts + mvn-settings: ric-plt-xapp-frame-cpp-settings + # test scripts depend on this name + build-dir: $WORKSPACE/build + # use an ubuntu for its modern compiler and cmake + build-node: ubuntu1804-builder-2c-2g + # install RMR per version file in repo + pre-build: !include-raw-escape: + - ../shell/install-deb-rmr3.sh + # verify and sonar use cmake + cmake-opts: -DDEV_PKG=1 + make-opts: install test ARGS=-V + +# verify changes +- project: + name: xapp-frame-cpp-verify + <<: *xapp_frame_cpp_common + jobs: + - gerrit-cmake-verify + stream: + - master: + branch: master + +# analyze C code and test coverage +- project: + name: xapp-frame-cpp-sonarqube + <<: *xapp_frame_cpp_common + sonar-project-file: "" + sonar-properties: | + sonar.login={sonarcloud_api_token} + sonar.projectKey={sonarcloud_project_organization}_{project-name} + sonar.projectName={project-name} + sonar.organization={sonarcloud_project_organization} + sonar.build.sourceEncoding=UTF-8 + sonar.sources=src + sonar.cfamily.build-wrapper-output=$WORKSPACE/bw-output + sonar.cfamily.gcov.reportsPath=test + jobs: + - gerrit-cmake-sonarqube diff --git a/jjb/shell/install-deb-rmr3.sh b/jjb/shell/install-deb-rmr3.sh new file mode 100644 index 00000000..ef5adece --- /dev/null +++ b/jjb/shell/install-deb-rmr3.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +# O-RAN-SC +# +# Copyright (C) 2020 AT&T Intellectual Property and Nokia +# +# 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. + +# Installs RMR ver 3.x headers and shared-object libraries +# from PackageCloud on a Debian; e.g., ubuntu 18.04 +# Reads RMR version number from repo file rmr-version.yaml +# Does NOT install or assume NNG + +echo "---> install-deb-rmr3.sh" + +# stop on error or unbound var, and be chatty +set -eux + +version_file=rmr-version.yaml +if [[ -f $version_file ]]; then + # pipeline is less elegant than yq but that requires venv and pip install + ver=$(grep "^version:" "$version_file" | cut -d: -f2 | xargs) +else + echo "File $version_file not found." + exit 1 +fi +if [[ -z $ver ]]; then + echo "Failed to get RMR version string from file $version_file" + exit 1 +else + echo "RMR version string is ${ver}" +fi + +# TODO use release repo, not staging +repo=staging +for deb in "rmr_${ver}_amd64.deb" "rmr-dev_${ver}_amd64.deb"; do + wget -q --content-disposition "https://packagecloud.io/o-ran-sc/${repo}/packages/debian/stretch/${deb}/download.deb" + sudo dpkg -i "${deb}" +done + +echo "---> install-deb-rmr3.sh ends" diff --git a/jjb/shell/install-rpm-rmr3.sh b/jjb/shell/install-rpm-rmr3.sh new file mode 100644 index 00000000..7406c03d --- /dev/null +++ b/jjb/shell/install-rpm-rmr3.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# O-RAN-SC +# +# Copyright (C) 2020 AT&T Intellectual Property and Nokia +# +# 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. + +# Installs RMR ver 3.x headers and shared-object libraries +# from PackageCloud on a CentOS +# Reads RMR version number from repo file rmr-version.yaml +# Does NOT install or assume NNG + +echo "---> install-rpm-rmr3.sh" + +# stop on error or unbound var, and be chatty +set -eux + +version_file=rmr-version.yaml +if [[ -f $version_file ]]; then + # pipeline is less elegant than yq but that requires venv and pip install + ver=$(grep "^version:" "$version_file" | cut -d: -f2 | xargs ) +else + echo "File $version_file not found." + exit 1 +fi +if [[ -z $ver ]]; then + echo "Failed to get RMR version string from file $version_file" + exit 1 +else + echo "RMR version string is ${ver}" +fi + +# TODO use release repo, not staging +# RPM packager adds suffix "-1" to version +repo=staging +for rpm in "rmr-${ver}-1.x86_64.rpm" "rmr-devel-${ver}-1.x86_64.rpm"; do + wget -q --content-disposition https://packagecloud.io/o-ran-sc/${repo}/packages/el/5/${rpm}/download.rpm + sudo rpm -iv ${rpm} +done + +echo "---> install-rpm-rmr3.sh ends"