summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Cmarada <mcmarada@cisco.com>2019-02-11 13:47:44 +0100
committerMichal Cmarada <mcmarada@cisco.com>2019-02-15 10:18:53 +0100
commitad682cc1bcc04b8ea27f1e535c45240702769a7c (patch)
tree3901f3fae3f89416da249b2238da261c8cfabbac
parent4b64bb80416e67acacb3408b6703a1f39ca8e195 (diff)
JVPP-22: introduce jvpp-verify job
Change-Id: Ie762e087046224b458eda9184b741ce2707edccb Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
-rw-r--r--jjb/jvpp/include-raw-jvpp-build.sh56
-rw-r--r--jjb/jvpp/jvpp.yaml92
-rw-r--r--jjb/scripts/setup_jvpp_dev_env.sh43
3 files changed, 191 insertions, 0 deletions
diff --git a/jjb/jvpp/include-raw-jvpp-build.sh b/jjb/jvpp/include-raw-jvpp-build.sh
new file mode 100644
index 000000000..7a0a5fa71
--- /dev/null
+++ b/jjb/jvpp/include-raw-jvpp-build.sh
@@ -0,0 +1,56 @@
+#!/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 "*******************************************************************"
diff --git a/jjb/jvpp/jvpp.yaml b/jjb/jvpp/jvpp.yaml
new file mode 100644
index 000000000..1a99ed2cb
--- /dev/null
+++ b/jjb/jvpp/jvpp.yaml
@@ -0,0 +1,92 @@
+---
+- project:
+ name: jvpp
+ jobs:
+ - 'jvpp-verify-{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
+ - naginator:
+ rerun-unstable-builds: false
+ max-failed-builds: 2
+ fixed-delay: 90
+ - email-notification:
+ email-prefix: '[jvpp]'
diff --git a/jjb/scripts/setup_jvpp_dev_env.sh b/jjb/scripts/setup_jvpp_dev_env.sh
new file mode 100644
index 000000000..8ef360869
--- /dev/null
+++ b/jjb/scripts/setup_jvpp_dev_env.sh
@@ -0,0 +1,43 @@
+#!/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