jobs:
- gerrit-info-yaml-verify
-- oam_features_common: &oam_features_common
- # project contains features of nonrtric-o1-controller
- # values apply to all projects here
- name: oam-features-common
- # git repo
+# common for all mvn jobs
+- oam_common: &oam_common
+ name: oam-common
project: oam
- # jenkins job name prefix
- project-name: oam-features
- # maven settings file has docker credentials
+ project-name: oam
mvn-settings: oam-settings
- # defaults.yaml value is NOT used due to value set in lf-maven-jobs.yaml
java-version: openjdk8
maven-version: mvn35
+
+# promote artifacts and images to release registries
+- project:
+ <<: *oam_common
+ name: oam-release
+ build-node: centos7-docker-2c-8g
+ jobs:
+ - '{project-name}-gerrit-release-jobs'
+
+# oam:features
+# commmon for feature artifacts for nonrtric-o1-controller
+- oam_features_common: &oam_features_common
+ name: oam-features-common
+ project-name: oam-features
mvn-opts: '-Xmx3072m -XX:MaxPermSize=1024m'
mvn-params: '-f features'
gerrit_trigger_file_paths:
- compare-type: REG_EXP
pattern: 'features/.*'
+# build feature artifacts for nonrtric-o1-controller
- project:
+ <<: *oam_common
<<: *oam_features_common
name: oam-features
build-node: ubuntu1804-builder-4c-4g
- 'master':
branch: 'master'
+# report test coverage periodically for feature artifacs
- project:
+ <<: *oam_common
<<: *oam_features_common
name: oam-features-sonar
sonarcloud: true
jobs:
- gerrit-maven-sonar
-- project:
- name: oam-release
- project-name: oam
- project: oam
- mvn-settings: oam-settings
- build-node: centos7-docker-2c-8g
- jobs:
- - '{project-name}-gerrit-release-jobs'
-
+# oam:parent
+# common for feature parents for nonrtric-o1-controller feature artifacts
- oam_parent_common: &oam_parent_common
- # project contains feature parents for nonrtric-o1-controller feature bundles
- # values apply to all projects here
name: oam-parent-common
- # git repo
- project: oam
- # jenkins job name prefix
project-name: oam-parent
- # maven settings file has docker credentials
- mvn-settings: oam-settings
- # defaults.yaml value is NOT used due to value set in lf-maven-jobs.yaml
- java-version: openjdk8
- maven-version: mvn35
mvn-opts: '-Xmx3072m -XX:MaxPermSize=1024m'
mvn-params: '-f parent'
gerrit_trigger_file_paths:
- compare-type: REG_EXP
pattern: 'parent/.*'
+# building feature parents for nonrtric-o1-controller feature artifacts
- project:
+ <<: *oam_common
<<: *oam_parent_common
name: oam-parents
build-node: ubuntu1804-builder-4c-4g
- 'master':
branch: 'master'
+# report test coverage periodically
- project:
+ <<: *oam_common
<<: *oam_parent_common
name: oam-parent-sonar
sonarcloud: true
build-node: ubuntu1604-builder-4c-4g
jobs:
- gerrit-maven-sonar
+
+# oam:distribution
+# common for oam-distribution docker projects
+- oam_distribution_common: &oam_distribution_common
+ name: oam-distribution-common
+ project-name: oam-distribution
+ mvn-opts: '-Xmx3072m -XX:MaxPermSize=1024m'
+ mvn-params: '-f distribution -Dbuild.number=${{BUILD_NUMBER}}'
+ gerrit_trigger_file_paths:
+ - compare-type: REG_EXP
+ pattern: 'distribution/.*'
+
+# build docker images for nonrtric-o1-controller
+- project:
+ <<: *oam_common
+ <<: *oam_distribution_common
+ name: oam-distribution
+ jobs:
+ - gerrit-maven-docker-verify
+ - gerrit-maven-docker-merge
+ - gerrit-maven-docker-stage
+ stream:
+ - master:
+ branch: 'master'
branch: master
build-days-to-keep: 7
- build-dir: "$WORKSPACE/target"
+ build-dir: "$WORKSPACE/build"
build-timeout: 15
cmake-opts: ""
cron: "" # avoid for PackageCloud which rejects duplicates
- shell: "{pre-build}"
- shell: !include-raw-escape: ../../global-jjb/shell/cmake-build.sh
- oran-packagecloud-push:
+ build-dir: "{build-dir}"
packagecloud-account: "{packagecloud-account}"
packagecloud-repo: "{packagecloud-repo}"
debian-distribution-versions: "{debian-distribution-versions}"
- shell: "{post_docker_build_script}"
- oran-docker-build-export
- oran-packagecloud-push:
+ build-dir: export-packages # directory with deb/rpm files
packagecloud-account: "{packagecloud-account}"
packagecloud-repo: "{packagecloud-repo}"
debian-distribution-versions: "{debian-distribution-versions}"
# See the License for the specific language governing permissions and
# limitations under the License.
-# Macros to invoke shell scripts for PackageCloud
-
- builder:
+ # provisions files required by package_cloud ruby gem
name: oran-packagecloud-file-provider
builders:
- config-file-provider:
target: "$HOME/packagecloud_api"
- builder:
+ # Runs shell script to push packages to PackageCloud.
+ # {build-dir} is directory with deb/rpm files to push
# {packagecloud-account} is PackageCloud account ID; example: oran
# {packagecloud-repo} is PackageCloud repository; example: master, staging
# {debian-distribution-versions} is list of DEB package distro/version strings
builders:
- inject:
properties-content: |
+ BUILD_DIR={build-dir}
PACKAGECLOUD_ACCOUNT={packagecloud-account}
PACKAGECLOUD_REPO={packagecloud-repo}
DEBIAN_DISTRIBUTION_VERSIONS={debian-distribution-versions}
RPM_DISTRIBUTION_VERSIONS={rpm-distribution-versions}
- - shell: !include-raw-escape:
- - ../shell/packagecloud-push.sh
+ - shell: !include-raw-escape: ../shell/packagecloud-push.sh
# Use ubuntu base for cmake v3
# Use docker variant for packagecloud ruby gem
build-node: ubuntu1804-docker-4c-4g
+ # install alien package to build RPMS
# install RMR per version file in repo for ubuntu
pre-build: !include-raw-escape:
+ - ../shell/install-deb-alien.sh
- ../shell/install-deb-rmr3.sh
- # verify and sonar use cmake
+
+# development library - publish only
+- project:
+ name: xapp-frame-cpp-lib-dev
+ <<: *xapp_frame_cpp_common
+ project-name: ric-plt-xapp-frame-cpp-dev
cmake-opts: -DDEV_PKG=1
- make-opts: install test ARGS=-V
+ make-opts: package ARGS=-V
+ jobs:
+ - oran-gerrit-cmake-pc-stage
+ stream:
+ - master:
+ branch: master
-# verify on changes, publish on stage
+# runtime library - test and publish
- project:
- name: xapp-frame-cpp-verify
+ name: xapp-frame-cpp-lib-rt
<<: *xapp_frame_cpp_common
+ project-name: ric-plt-xapp-frame-cpp-lib
+ cmake-opts: -DDEV_PKG=0
+ make-opts: test package ARGS=-V
jobs:
- gerrit-cmake-verify
- oran-gerrit-cmake-pc-stage
- project:
name: xapp-frame-cpp-sonarqube
<<: *xapp_frame_cpp_common
+ make-opts: test ARGS=-V
sonar-project-file: ""
sonar-properties: |
sonar.login={sonarcloud_api_token}
# that copies artifacts created by the builder to a directory.
# Environment variables are injected in previous Jenkins steps.
# The push script searches the workspace, so do not use /tmp etc.
-HOST=$WORKSPACE/export-packages-$$
+HOST=$WORKSPACE/export-packages
GUEST=/export
mkdir -p "$HOST"
docker run -v "$HOST":"$GUEST" "$CONTAINER_PUSH_REGISTRY"/"$DOCKER_NAME":"$DOCKER_IMAGE_TAG" "$GUEST"
ls "$HOST"
+
+echo "--> export-packages.sh ends"
--- /dev/null
+#!/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 Debian package 'alien' to support building RPMs
+
+echo "---> install-deb-alien.sh"
+
+# stop on error or unbound var, and be chatty
+set -eux
+
+sudo apt-get update && sudo apt-get -q -y install alien
+
+echo "---> install-deb-alien.sh ends"
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}
+rm -f ${deb}
echo "---> install-deb-nng-rmr.sh ends"
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}"
+ rm -f "${deb}"
done
echo "---> install-deb-rmr3.sh ends"
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}
+rm -f ${rpm}
echo "---> install-rpm-nng-rmr.sh ends"
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}
+ wget -nv --content-disposition "https://packagecloud.io/o-ran-sc/${repo}/packages/el/5/${rpm}/download.rpm"
+ sudo rpm -iv "${rpm}"
+ rm -f "${rpm}"
done
echo "---> install-rpm-rmr3.sh ends"
#!/bin/bash -l
# SPDX-License-Identifier: EPL-1.0
##############################################################################
-# Copyright (c) 2019 The Linux Foundation and others.
+# Copyright (c) 2020 The Linux Foundation and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
##############################################################################
+
+# Prereqs:
+# The build minion has the ruby gem "package_cloud"
+# The required credentials and API files have been provisioned
+# The build directory has .deb/.rpm files
+# Environment variables:
+# BUILD_DIR is set and non-empty
+# DEBIAN_DISTRIBUTION_VERSIONS has distro list like "debian/stretch"
+# RPM_DISTRIBUTION_VERSIONS has distro list like "el/4 el/5"
+# PACKAGECLOUD_ACCOUNT is set and non-empty
+# PACKAGECLOUD_REPO is a value like "staging"
+
echo "---> packagecloud-push.sh"
set -eu -o pipefail
-if [ ! -f ~/.packagecloud ]; then
- echo "INFO: .packagecloud file not found"
- exit 0
-fi
-
- # For DEB
-vers=("$DEBIAN_DISTRIBUTION_VERSIONS")
-echo "Debian distribution versions:" "${vers[@]}"
-debs=$(find . -type f -iname '*.deb')
-# modern bash syntax is helpful
-for (( i = 0; i < ${#vers[@]}; i++ )); do
- for deb in $debs; do
- echo "Pushing $deb $PACKAGECLOUD_ACCOUNT/$PACKAGECLOUD_REPO/${vers[i]}"
- package_cloud push "$PACKAGECLOUD_ACCOUNT"/"$PACKAGECLOUD_REPO"/"${vers[i]}" "$deb"
+# Pushes packages to PackageCloud
+# $1 is a shell-style glob pattern for package files
+# $2 is a space-separated list of distribution versions
+push_packages () {
+ echo "Expanding file pattern $1"
+ # shellcheck disable=SC2206
+ pkgs=($1)
+ if [[ ! -f ${pkgs[0]} ]]; then
+ echo "WARN: no files matched pattern $1"
+ return
+ fi
+ echo "Found package file(s):" "${pkgs[@]}"
+ echo "Processing distribution version(s): $2"
+ for ver in $2; do
+ arg="${PACKAGECLOUD_ACCOUNT}/${PACKAGECLOUD_REPO}/${ver}"
+ for pkg in "${pkgs[@]}"; do
+ echo "Pushing $arg $pkg"
+ package_cloud push "$arg" "$pkg"
+ done
done
-done
+}
-# For RPM
-vers=("$RPM_DISTRIBUTION_VERSIONS")
-echo "RPM distribution versions:" "${vers[@]}"
-rpms=$(find . -type f -iregex '.*/.*\.\(s\)?rpm')
-# modern bash syntax is helpful
-for (( i = 0; i < ${#vers[@]}; i++ )); do
- for rpm in $rpms; do
- echo "Pushing $rpm $PACKAGECLOUD_ACCOUNT/$PACKAGECLOUD_REPO/${vers[i]}"
- package_cloud push "$PACKAGECLOUD_ACCOUNT"/"$PACKAGECLOUD_REPO"/"${vers[i]}" "$rpm"
- done
-done
+echo "Working in directory $BUILD_DIR"
+cd "$BUILD_DIR"
+push_packages "*.deb" "$DEBIAN_DISTRIBUTION_VERSIONS"
+push_packages "*.rpm" "$RPM_DISTRIBUTION_VERSIONS"
+
+echo "---> packagecloud-push.sh ends"