Merge "Adapt to restructuring of code in repo"
authorAric Gardner <agardner@linuxfoundation.org>
Thu, 26 Mar 2020 15:40:32 +0000 (15:40 +0000)
committerGerrit Code Review <gerrit@o-ran-sc.org>
Thu, 26 Mar 2020 15:40:32 +0000 (15:40 +0000)
jjb/ric-plt-xapp-frame-cpp/ric-plt-xapp-frame-cpp.yaml
jjb/shell/install-deb-nng-rmr.sh
jjb/shell/install-deb-rmr3.sh [new file with mode: 0644]
jjb/shell/install-rpm-nng-rmr.sh
jjb/shell/install-rpm-rmr3.sh [new file with mode: 0644]

index 84336e3..f28f515 100644 (file)
@@ -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
index c242a23..c3cd175 100644 (file)
@@ -62,7 +62,7 @@ git clone https://github.com/nanomsg/nng.git
 
 deb="rmr_${ver}_amd64.deb"
 echo "Download RMR library ${ver} as file ${deb}"
-wget --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/${deb}/download.deb
+wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/${deb}/download.deb
 echo "Install RMR library file ${deb}"
 sudo dpkg -i ${deb}
 
diff --git a/jjb/shell/install-deb-rmr3.sh b/jjb/shell/install-deb-rmr3.sh
new file mode 100644 (file)
index 0000000..ef9e7e9
--- /dev/null
@@ -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; does NOT install or assume NNG.
+# Reads RMR version number from repo file rmr-version.yaml like this:
+#   ---
+#   repo: staging             (this entry is optional)
+#   version: 3.6.1            (this entry is required)
+
+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
+    repo=$(grep "^repo:" "$version_file" | cut -d: -f2 | xargs )
+    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
+fi
+# default to release repo; accept override to use staging repo
+repo=${repo:-"release"}
+# 
+for deb in "rmr_${ver}_amd64.deb" "rmr-dev_${ver}_amd64.deb"; do
+    wget -nv --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"
index af7d05a..61baea9 100644 (file)
@@ -62,7 +62,7 @@ git clone https://github.com/nanomsg/nng.git
 # RPM packager adds suffix "-1" to version
 rpm="rmr-${ver}-1.x86_64.rpm"
 echo "Download RMR library ${ver} as file ${rpm}"
-wget --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/el/5/${rpm}/download.rpm
+wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/el/5/${rpm}/download.rpm
 echo "Install RMR library file ${rpm}"
 sudo rpm -iv ${rpm}
 
diff --git a/jjb/shell/install-rpm-rmr3.sh b/jjb/shell/install-rpm-rmr3.sh
new file mode 100644 (file)
index 0000000..3970f1f
--- /dev/null
@@ -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 CentOS; does NOT install or assume NNG.
+# Reads RMR version number from repo file rmr-version.yaml like this:
+#   ---
+#   repo: staging             (this entry is optional)
+#   version: 3.6.1            (this entry is required)
+
+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
+    repo=$(grep "^repo:" "$version_file" | cut -d: -f2 | xargs )
+    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
+fi
+# default to release repo; accept override to use staging repo
+repo=${repo:-"release"}
+# RPM packager adds suffix "-1" to version
+for rpm in "rmr-${ver}-1.x86_64.rpm" "rmr-devel-${ver}-1.x86_64.rpm"; do
+    wget -nv --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"