summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorThomas F Herbert <therbert@redhat.com>2016-01-23 19:06:55 -0500
committerThomas F Herbert <therbert@redhat.com>2016-01-31 00:16:08 -0500
commit4c54b37aca48867c694539692a3ada76be39f4d6 (patch)
treea99b48f4420c53058fad82260a752b3f4dcb9aa3 /ci
parent4aa1ce14bb812da904f65e8c8f6e6a92053a41e3 (diff)
Introduce ability to accept command arguments to build with DPDK or Linux kernel.
Specify patches to apply, build kernel module RPM and build with a special version of the kernel. Also instack_ovs.sh creates a VM for building and initial testing of RPMs and copies scripts to VMs build_ovs_rpm.sh builds the RPM according to command line options. test_ovs_rpm.sh tests the RPM by installing the RPM and running some ovs commands to create a bridge and dump flows. Also add two scripts generally to be executed in VM to do actual building and Testing. This 2nd series adds the following: Use fedora spec file for kmod builds. Added Explanations to configuration options. Fixes in response to review comments. Rename script for clarity and change references: buildtestovs.sh -> BuildTestOVS.sh Fix nocheck option, print default options, fix kmod option, fix test of kmod. For command line options execute build/buildtestovs.sh -h Change-Id: I415ca39afab27482b1cb473d392f48b36c8e0745 Signed-off-by: Thomas F Herbert <therbert@redhat.com>
Diffstat (limited to 'ci')
-rwxr-xr-xci/buildovs.sh119
-rwxr-xr-xci/clean.sh43
2 files changed, 75 insertions, 87 deletions
diff --git a/ci/buildovs.sh b/ci/buildovs.sh
index 77cb96d..db3ac9b 100755
--- a/ci/buildovs.sh
+++ b/ci/buildovs.sh
@@ -1,12 +1,16 @@
#!/bin/bash
##############################################################################
-# Copyright (c) 2015 Red Hat Inc. and others.
+# Copyright (c) 2015,2016 Red Hat Inc. and others.
# therbert@redhat.com
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+set -e
+
+echo "==================================="
+echo executing $0 $@
# Check to verify that I am being run by Jenkins CI.
@@ -16,9 +20,7 @@ if [ -z ${WORKSPACE+1} ]; then
fi
-if [ -z ${OVSTAG+1} ]; then
- export TAG=master
-else
+if [ ${OVSTAG} ]; then
export TAG=$OVSTAG
fi
@@ -38,7 +40,6 @@ if [ ! -f $BUILD_BASE/config ]; then
fi
export PATH=$PATH:$WORKSPACE/ci:$BUILD_BASE
-
source $BUILD_BASE/config
cd $BUILD_BASE
@@ -65,95 +66,26 @@ then
mkdir -p $TMP_RELEASE_DIR
fi
-# Centos build server should support the following build prerequisites
-
-# yum install gcc make python-devel openssl-devel kernel-devel graphviz \
-# kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \
-# libtool
-
-if [ -d $TMPDIR ]
-then
- rm -rf $TMPDIR
-fi
-
-mkdir $TMPDIR
-
-cd $TMPDIR
-
-echo "---------------------"
-echo "Clone git repo $TAG"
-echo
-git clone https://github.com/openvswitch/ovs.git
-
-cd ovs
-echo "--------------------"
-echo "Checkout OVS $TAG"
-echo
-if [[ ! "$TAG" =~ "master" ]]; then
- git checkout $TAG
-fi
-./boot.sh
-./configure
-echo "--------------------"
-echo "Make OVS $TAG"
-echo
-make
#
-# Get version for master
+# Build ovs rpm without DPDK from ovs master
+#
+echo =======Build ovs rpm and ovs kmod rpm without DPDK Test in VM==========
+ BuildAndTestOVS.sh -p none -t
+#
+# Build ovs rpm with DPDK
+#
+echo =======Build ovs rpm with DPDK Test in VM==========
+BuildAndTestOVS.sh -d -p none -t
+#
+# Build special version of ovs with patches --TODO
#
-echo "--------------------"
-echo "Get OVS version for $TAG"
-echo
-if [[ "$TAG" =~ "master" ]]; then
- v=$($TMPDIR/ovs/utilities/ovs-vsctl --version | head -1 | cut -d' ' -f4)
- export VERSION=$v
-else
- export VERSION=${TAG:1}
-fi
-
-echo "--------------------"
-echo "OVS version is $VERSION"
-echo
-echo "--------------------"
-echo "Make OVS distribution $TAG"
-echo
-
-make dist
-
-cd $TMPDIR/ovs
-
-cp openvswitch-$VERSION.tar.gz $TOPDIR/rpmbuild/SOURCES
-cp openvswitch-$VERSION.tar.gz $TMPDIR
-
-cd $TMPDIR
-tar -xzf openvswitch-$VERSION.tar.gz
-
-cd $TMPDIR/openvswitch-$VERSION
-
-
-echo "--------------------"
-echo "Build OVS RPM"
-echo
-
-if [ ! -z ${NOCHECK+1} ]; then
- # Build RPM without checks
- #
- rpmbuild -bb --define "_topdir `echo $RPMDIR`" --without check rhel/openvswitch.spec
-else
- rpmbuild -bb --define "_topdir `echo $RPMDIR`" rhel/openvswitch.spec
-fi
# Once build is done copy product to artifactory.
+# and cleanup
-echo "---------------------------------------"
-echo "Copy RPM into $TMP_RELEASE_DIR"
-echo
-cp $RPMDIR/RPMS/x86_64/*.rpm $TMP_RELEASE_DIR
-
-# cleanup
echo "---------------------------------------"
-echo "Cleanup $TMP_RELEASE_DIR"
+echo "Cleanup temporary dirs"
echo
cd $BUILDDIR
@@ -169,4 +101,17 @@ if [[ "$JOB_NAME" =~ "daily" ]]; then
upload_artifacts.sh
fi
+if [ -d $TMP_RELEASE_DIR ]; then
+ rm -rf $CACHE_RELEASE_DIR
+fi
+
+if [ -d $RPMDIR ]; then
+ rm -rf $RPMDIR
+fi
+
+# Destroy VM if one has been deployed. Also remove any local installation of
+# DPDK and OVS
+#
+clean.sh
+
exit 0
diff --git a/ci/clean.sh b/ci/clean.sh
new file mode 100755
index 0000000..b1033b0
--- /dev/null
+++ b/ci/clean.sh
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+##############################################################################
+# Copyright (c) 2016 Red Hat Inc. and others.
+# therbert@redhat.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+#Clean script to uninstall provisioning server for Apex
+#author: Dan Radez (dradez@redhat.com)
+#
+vm_index=4
+
+# Clean off instack VM
+virsh destroy instack 2> /dev/null || echo -n ''
+virsh undefine instack --remove-all-storage 2> /dev/null || echo -n ''
+virsh vol-delete instack.qcow2 --pool default 2> /dev/null
+rm -f /var/lib/libvirt/images/instack.qcow2 2> /dev/null
+
+# Clean off baremetal VMs in case they exist
+for i in $(seq 0 $vm_index); do
+ virsh destroy baremetalbrbm_brbm1_$i 2> /dev/null || echo -n ''
+ virsh undefine baremetalbrbm_brbm1_$i --remove-all-storage 2> /dev/null || echo -n ''
+ virsh vol-delete baremetalbrbm_brbm1_${i}.qcow2 --pool default 2> /dev/null
+ rm -f /var/lib/libvirt/images/baremetalbrbm_brbm1_${i}.qcow2 2> /dev/null
+done
+
+# Clean off brbm bridges
+virsh net-destroy brbm 2> /dev/null
+virsh net-undefine brbm 2> /dev/null
+vs-vsctl del-br brbm 2> /dev/null
+
+virsh net-destroy brbm1 2> /dev/null
+virsh net-undefine brbm1 2> /dev/null
+vs-vsctl del-br brbm1 2> /dev/null
+
+# clean pub keys from root's auth keys
+sed -i '/stack@instack.localdomain/d' /root/.ssh/authorized_keys
+sed -i '/virtual-power-key/d' /root/.ssh/authorized_keys
+
+
+echo "Cleanup Completed"