--- /dev/null
+#!/bin/bash
+# basic build script example
+set -xe -o pipefail
+
+OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
+OS_VERSION_ID=$(grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
+
+echo OS_ID: ${OS_ID}
+echo OS_VERSION_ID: ${OS_VERSION_ID}
+
+# do nothing but print the current slave hostname
+hostname
+export CCACHE_DIR=/tmp/ccache
+if [[ -d ${CCACHE_DIR} ]];then
+ echo ${CCACHE_DIR} exists
+ du -sk ${CCACHE_DIR}
+else
+ echo ${CCACHE_DIR} does not exist. This must be a new slave.
+fi
+
+echo "cat /etc/bootstrap.sha"
+if [[ -f /etc/bootstrap.sha ]];then
+ cat /etc/bootstrap.sha
+else
+ echo "Cannot find cat /etc/bootstrap.sha"
+fi
+
+echo "cat /etc/bootstrap-functions.sha"
+if [[ -f /etc/bootstrap-functions.sha ]];then
+ cat /etc/bootstrap-functions.sha
+else
+ echo "Cannot find cat /etc/bootstrap-functions.sha"
+fi
+
+echo "sha1sum of this script: ${0}"
+sha1sum $0
+
+echo "CC=${CC}"
+
+echo "Building using \"make package\""
+# ensure that we build from scratch
+./clean.sh
+[[ "x${DRYRUN}" == "xTrue" ]] || cd Requirements && make UNATTENDED=yes install-dep && cd ..
+[[ "x${DRYRUN}" == "xTrue" ]] || pwd
+if [[ "${OS_ID}" == "centos" ]]; then
+ [[ "x${DRYRUN}" == "xTrue" ]] || cmake3 .
+else
+ [[ "x${DRYRUN}" == "xTrue" ]] || cmake .
+fi
+
+[[ "x${DRYRUN}" == "xTrue" ]] || make package
+# This will build deb or rpm JVPP package based on OS. Built packages are located in build-root/packages/
+
+echo "*******************************************************************"
+echo "* JVPP BUILD SUCCESSFULLY COMPLETED"
+echo "*******************************************************************"
--- /dev/null
+#!/bin/bash
+set -xe -o pipefail
+echo "*******************************************************************"
+echo "* STARTING PUSH OF JVPP PACKAGES TO REPOS"
+echo "* NOTHING THAT HAPPENS BELOW THIS POINT IS RELATED TO BUILD FAILURE"
+echo "*******************************************************************"
+
+[ "$MVN" ] || MVN="/opt/apache/maven/bin/mvn"
+GROUP_ID="io.fd.${PROJECT}"
+BASEURL="${NEXUSPROXY}/content/repositories/fd.io."
+BASEREPOID='fdio-'
+
+if [ "${OS}" == "ubuntu1604" ]; then
+ # Find the files
+ JARS=$(find ./java -type f -iname '*.jar')
+ DEBS=$(find ./build-root/packages/ -type f -iname '*.deb')
+ for i in $JARS
+ do
+ push_jar "$i"
+ done
+
+ for i in $DEBS
+ do
+ push_deb "$i"
+ done
+elif [ "${OS}" == "ubuntu1804" ]; then
+ # Find the files
+ JARS=$(find ./java -type f -iname '*.jar')
+ DEBS=$(find ./build-root/packages/ -type f -iname '*.deb')
+ for i in $JARS
+ do
+ push_jar "$i"
+ done
+
+ for i in $DEBS
+ do
+ push_deb "$i"
+ done
+elif [ "${OS}" == "centos7" ]; then
+ # Find the files
+ RPMS=$(find ./build-root/packages/ -type f -iname '*.rpm')
+ SRPMS=$(find ./build-root/packages/ -type f -iname '*.srpm')
+ SRCRPMS=$(find ./build-root/packages/ -type f -name '*.src.rpm')
+ for i in $RPMS $SRPMS $SRCRPMS
+ do
+ push_rpm "$i"
+ done
+fi
+# vim: ts=4 sw=4 sts=4 et ft=sh :
--- /dev/null
+#!/bin/bash
+# PCIO_CO is a Jenkins Global Environment variable
+
+set -x
+
+echo "STARTING JVPP PACKAGECLOUD PUSH"
+
+sleep 10
+
+FACTER_OS=$(/usr/bin/facter operatingsystem)
+
+if [ -f ~/.packagecloud ]; then
+ case "$FACTER_OS" in
+ Ubuntu)
+ FACTER_LSBNAME=$(/usr/bin/facter lsbdistcodename)
+ DEBS=$(find ./build-root/packages/ -type f -iname '*.deb')
+ package_cloud push "${PCIO_CO}/${STREAM}/ubuntu/${FACTER_LSBNAME}/main/" ${DEBS}
+ ;;
+ CentOS)
+ FACTER_OSMAJREL=$(/usr/bin/facter operatingsystemmajrelease)
+ FACTER_ARCH=$(/usr/bin/facter architecture)
+ RPMS=$(find ./build-root/packages/ -type f -iregex '.*/.*\.\(s\)?rpm')
+ package_cloud push "${PCIO_CO}/${STREAM}/el/${FACTER_OSMAJREL}/os/${FACTER_ARCH}/" ${RPMS}
+ ;;
+ esac
+fi
--- /dev/null
+---
+- project:
+ name: jvpp
+ jobs:
+ - 'jvpp-verify-{stream}-{os}'
+ - 'jvpp-merge-{stream}-{os}'
+ project: 'jvpp'
+ os:
+ - ubuntu1604:
+ repo-os-part: 'ubuntu.xenial.main'
+ skip-site: 'false'
+ skip-jar-deploy: 'false'
+ - ubuntu1804:
+ repo-os-part: 'ubuntu.bionic.main'
+ skip-site: 'false'
+ skip-jar-deploy: 'false'
+ - centos7:
+ repo-os-part: 'centos7'
+ skip-site: 'true'
+ skip-jar-deploy: 'true'
+ stream:
+ - master:
+ branch: 'master'
+ repo-stream-part: 'master'
+
+- project:
+ name: jvpp-view
+ views:
+ - project-view
+ project-name: jvpp
+
+- job-template:
+ name: 'jvpp-verify-{stream}-{os}'
+
+ project-type: freestyle
+ node: '{os}-us'
+ concurrent: true
+
+ build-discarder:
+ daysToKeep: '{build-days-to-keep}'
+ numToKeep: '{build-num-to-keep}'
+ artifactDaysToKeep: '{build-artifact-days-to-keep}'
+ artifactNumToKeep: '{build-artifact-num-to-keep}'
+
+ parameters:
+ - project-parameter:
+ project: '{project}'
+ - gerrit-parameter:
+ branch: '{branch}'
+ - os-parameter:
+ os: '{os}'
+ - repo-name-parameter:
+ repo-name: '{repo-stream-part}.{repo-os-part}'
+ - stream-parameter:
+ stream: '{stream}'
+
+ scm:
+ - gerrit-trigger-scm:
+ credentials-id: 'jenkins-gerrit-credentials'
+ refspec: '$GERRIT_REFSPEC'
+ choosing-strategy: 'gerrit'
+
+ wrappers:
+ - fdio-infra-wrappers:
+ build-timeout: '{build-timeout}'
+
+ triggers:
+ - gerrit-trigger-patch-submitted:
+ name: '{project}'
+ branch: '{branch}'
+
+ builders:
+ - shell:
+ !include-raw-escape:
+ - ../scripts/setup_jvpp_dev_env.sh
+ - include-raw-jvpp-build.sh
+
+ publishers:
+ - archive:
+ artifacts: >
+ **/build-root/packages/*.rpm,
+ **/build-root/packages/*.deb
+
+ allow-empty: 'true'
+ fingerprint: false
+ only-if-success: true
+ default-excludes: false
+ - fdio-infra-shiplogs:
+ maven-version: 'mvn33-new'
+ archive-artifacts: '/tmp/jvpp-failed-unittests/*/* **/core'
+ - naginator:
+ rerun-unstable-builds: false
+ max-failed-builds: 2
+ fixed-delay: 90
+ - email-notification:
+ email-prefix: '[jvpp]'
+
+- job-template:
+ name: 'jvpp-merge-{stream}-{os}'
+
+ project-type: freestyle
+ node: '{os}-us'
+
+ build-discarder:
+ daysToKeep: '{build-days-to-keep}'
+ numToKeep: 100
+ artifactDaysToKeep: '{build-artifact-days-to-keep}'
+ artifactNumToKeep: '{build-artifact-num-to-keep}'
+
+ parameters:
+ - project-parameter:
+ project: '{project}'
+ - gerrit-parameter:
+ branch: '{branch}'
+ - os-parameter:
+ os: '{os}'
+ - maven-project-parameter:
+ maven: 'mvn33-new'
+ - maven-exec:
+ maven-version: 'mvn33-new'
+ - stream-parameter:
+ stream: '{stream}'
+ - repo-name-parameter:
+ repo-name: '{repo-stream-part}.{repo-os-part}'
+
+ scm:
+ - gerrit-trigger-scm:
+ credentials-id: 'jenkins-gerrit-credentials'
+ refspec: ''
+ choosing-strategy: 'default'
+
+ wrappers:
+ - fdio-infra-wrappers:
+ build-timeout: '{build-timeout}'
+
+ triggers:
+ - gerrit-trigger-patch-merged:
+ name: '{project}'
+ branch: '{branch}'
+ - reverse:
+ jobs: 'vpp-merge-{stream}-{os}'
+ result: 'success'
+
+ builders:
+ - config-file-provider:
+ files:
+ - file-id: '.packagecloud'
+ target: '/root'
+ - config-file-provider:
+ files:
+ - file-id: 'packagecloud_api'
+ target: '/root'
+ - maven-target:
+ maven-version: 'mvn33-new'
+ goals: '--version'
+ settings: 'vpp-settings'
+ settings-type: cfp
+ global-settings: 'global-settings'
+ global-settings-type: cfp
+ - shell:
+ !include-raw-escape:
+ - ../scripts/setup_jvpp_dev_env.sh
+ - include-raw-jvpp-build.sh
+ - provide-maven-settings:
+ settings-file: 'jvpp-settings'
+ global-settings-file: 'global-settings'
+ - shell:
+ !include-raw-escape:
+ - ./include-raw-jvpp-packetcloud-push.sh
+ - shell:
+ !include-raw-escape:
+ - ../scripts/maven_push_functions.sh
+ - include-raw-jvpp-maven-push.sh
+
+ publishers:
+ - archive:
+ artifacts: >
+ **/build-root/packages/*.rpm,
+ **/build-root/packages/*.deb
+ allow-empty: 'true'
+ fingerprint: false
+ only-if-success: true
+ default-excludes: false
+ - fdio-infra-shiplogs:
+ maven-version: 'mvn33-new'
+ - naginator:
+ rerun-unstable-builds: false
+ max-failed-builds: 1
+ fixed-delay: 90
+ - email-notification:
+ email-prefix: '[jvpp]'
openSUSE)
# Use /etc/os-release on openSUSE to get $VERSION
. /etc/os-release
- RPMS=$(find . -type f -iregex '.*/.*\.\(s\)?rpm')
+ RPMS=$(find . -type f -iregex '.*/.*\.\(s\)?rpm' | grep -v 'vpp-ext-deps')
+ VPP_EXT_RPMS=$(find . -type f -iregex '.*/.*\.\(s\)?rpm' | grep 'vpp-ext-deps')
package_cloud push "${PCIO_CO}/${STREAM}/opensuse/${VERSION}/" ${RPMS}
+ # This file may have already been uploaded. Don't error out if it exists.
+ package_cloud push "${PCIO_CO}/${STREAM}/opensuse/${VERSION}/" ${VPP_EXT_RPMS} --skip-errors
;;
esac
fi
--- /dev/null
+#!/bin/bash
+set -e -o pipefail
+
+# Figure out what system we are running on
+if [[ -f /etc/lsb-release ]];then
+ . /etc/lsb-release
+elif [[ -f /etc/redhat-release ]];then
+ sudo yum install -y redhat-lsb
+ DISTRIB_ID=`lsb_release -si`
+ DISTRIB_RELEASE=`lsb_release -sr`
+ DISTRIB_CODENAME=`lsb_release -sc`
+ DISTRIB_DESCRIPTION=`lsb_release -sd`
+fi
+echo DISTRIB_ID: $DISTRIB_ID
+echo DISTRIB_RELEASE: $DISTRIB_RELEASE
+echo DISTRIB_CODENAME: $DISTRIB_CODENAME
+echo DISTRIB_DESCRIPTION: $DISTRIB_DESCRIPTION
+
+function setup {
+ if ! [[ -z ${REPO_NAME} ]]; then
+ echo "INSTALLING VPP-DPKG-DEV from apt/yum repo"
+ REPO_URL="https://packagecloud.io/fdio/${STREAM}"
+ echo "REPO_URL: ${REPO_URL}"
+ # Setup by installing vpp-dev and vpp-lib
+ if [[ "$DISTRIB_ID" == "Ubuntu" ]]; then
+ if [[ -f /etc/apt/sources.list.d/99fd.io.list ]];then
+ echo "Deleting: /etc/apt/sources.list.d/99fd.io.list"
+ sudo rm /etc/apt/sources.list.d/99fd.io.list
+ fi
+ curl -s https://packagecloud.io/install/repositories/fdio/${STREAM}/script.deb.sh | sudo bash
+ sudo apt-get -y --force-yes install libvppinfra libvppinfra-dev vpp vpp-dev vpp-plugin-core || true
+ elif [[ "$DISTRIB_ID" == "CentOS" ]]; then
+ if [[ -f /etc/yum.repos.d/fdio-master.repo ]]; then
+ echo "Deleting: /etc/yum.repos.d/fdio-master.repo"
+ sudo rm /etc/yum.repos.d/fdio-master.repo
+ fi
+ curl -s https://packagecloud.io/install/repositories/fdio/${STREAM}/script.rpm.sh | sudo bash
+ sudo yum -y install vpp-devel vpp-lib vpp-plugins || true
+ fi
+ fi
+}
+
+setup
\ No newline at end of file