3 # Copyright (c) 2016 Open Platform for NFV Project, Inc. and its contributors
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
19 echo "==================================="
22 # Check to verify that I am being run by Jenkins CI.
24 if [ -z ${WORKSPACE+1} ]; then
25 # We are not being run by Jenkins.
26 export WORKSPACE=$HOME/opnfv/ovsnfv
30 if [ ${OVSTAG} ]; then
34 export DATE=`date +%Y-%m-%d`
36 export BUILD_BASE=$WORKSPACE/build
40 if [ ! -d $BUILD_BASE ]
45 if [ ! -f $BUILD_BASE/config ]; then
46 touch $BUILD_BASE/config
49 export PATH=$PATH:$WORKSPACE/ci:$BUILD_BASE
50 source $BUILD_BASE/config
53 export TOPDIR=$BUILD_BASE
57 export TMP_RELEASE_DIR=$TOPDIR/release
58 export CACHE_DIR=$TOPDIR/cache
59 export TMPDIR=$TOPDIR/scratch
60 export RPMDIR=$TOPDIR/rpmbuild
63 mkdir -p $RPMDIR/SOURCES
64 mkdir -p $RPMDIR/SPECS
65 mkdir -p $RPMDIR/SRPMS
67 if [ ! -d $TMP_RELEASE_DIR ]
69 mkdir -p $TMP_RELEASE_DIR
73 # Build ovs rpm with DPDK
75 echo =============================================
76 echo =======Build ovs rpm with DPDK and test in VM.
78 $BUILD_BASE/BuildAndTestOVS.sh -d -g master -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
101 $BUILD_BASE/../ci/upload_artifacts.sh
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
115 sudo $BUILD_BASE/../ci/clean.sh