2 ##############################################################################
3 # Copyright (c) 2015,2016 Red Hat Inc. and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
12 echo "==================================="
15 # Check to verify that I am being run by Jenkins CI.
17 if [ -z ${WORKSPACE+1} ]; then
18 # We are not being run by Jenkins.
19 export WORKSPACE=$HOME/opnfv/ovsnfv
23 if [ ${OVSTAG} ]; then
27 export DATE=`date +%Y-%m-%d`
29 export BUILD_BASE=$WORKSPACE/build
33 if [ ! -d $BUILD_BASE ]
38 if [ ! -f $BUILD_BASE/config ]; then
39 touch $BUILD_BASE/config
42 export PATH=$PATH:$WORKSPACE/ci:$BUILD_BASE
43 source $BUILD_BASE/config
46 export TOPDIR=$BUILD_BASE
50 export TMP_RELEASE_DIR=$TOPDIR/release
51 export CACHE_DIR=$TOPDIR/cache
52 export TMPDIR=$TOPDIR/scratch
53 export RPMDIR=$TOPDIR/rpmbuild
55 echo "--------------------------------------------------"
56 echo "Build OVS RPM from upstream git $TAG"
60 mkdir -p $RPMDIR/SOURCES
61 mkdir -p $RPMDIR/SPECS
62 mkdir -p $RPMDIR/SRPMS
64 if [ ! -d $TMP_RELEASE_DIR ]
66 mkdir -p $TMP_RELEASE_DIR
70 # Build ovs rpm without DPDK from ovs master
72 echo =======Build ovs rpm and ovs kmod rpm without DPDK Test in VM==========
73 BuildAndTestOVS.sh -p none -t
75 # Build ovs rpm with DPDK
77 echo =======Build ovs rpm with DPDK Test in VM==========
78 BuildAndTestOVS.sh -d -p none -t
80 # Build special version of ovs with patches --TODO
83 # Once build is done copy product to artifactory.
87 echo "---------------------------------------"
88 echo "Cleanup temporary dirs"
100 if [[ "$JOB_NAME" =~ "daily" ]]; then
104 if [ -d $TMP_RELEASE_DIR ]; then
105 rm -rf $CACHE_RELEASE_DIR
108 if [ -d $RPMDIR ]; then
112 # Destroy VM if one has been deployed. Also remove any local installation of