diff options
author | Thomas F Herbert <therbert@redhat.com> | 2016-06-27 10:37:46 -0400 |
---|---|---|
committer | Thomas F Herbert <therbert@redhat.com> | 2016-06-29 13:40:42 -0400 |
commit | 1fe93bf666765927d9ed15ead14db85caf51098c (patch) | |
tree | 7d38e1a8d3316a09e8cf9742940fb9b54bd56af5 /build/BuildAndTestOVS.sh | |
parent | 36014367fcc0cd5cd1942cb077c6f52244a3164a (diff) |
RPM: Apex: Refactor build scripts:
Remove reference to undercloud.
Fix dependencies list.
Refactor build ovs and build dpdk and test scripts.
Correct default dpdk version in build ovs script.
Remove references to instack VM -- no longer necessary.
Remove script using custom Apex-lite-liberty for testing
Consolidated functions and cleanup in response to reviewers.
Change-Id: I0875acd87580769c7cd7e87b97bb3e04f0159b32
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
Diffstat (limited to 'build/BuildAndTestOVS.sh')
-rwxr-xr-x | build/BuildAndTestOVS.sh | 87 |
1 files changed, 56 insertions, 31 deletions
diff --git a/build/BuildAndTestOVS.sh b/build/BuildAndTestOVS.sh index 10a2f05..f12ab3e 100755 --- a/build/BuildAndTestOVS.sh +++ b/build/BuildAndTestOVS.sh @@ -72,8 +72,26 @@ while getopts "a:dg:hi:p:tu:v" opt; do esac done -if [ -z $TAG ]; then - TAG=master +# +# Default Config options +# +echo =============================================== +echo Default Configuration Options. +echo =============================================== +echo option NOCHECK is set to $NOCHECK +echo build DPDK option is set to $DPDK +echo DPDK Patch URL is set to $DPDK_PATCH +echo DPDK Version is set to $DPDK_VERSION +echo Option for OVS Kernel Module is set to $KMOD +echo =============================================== +if [[ $NOCHECK =~ "yes" ]]; then + setnocheck="-c" +fi +if [[ $KMOD =~ "yes" ]]; then + setkmod="-k" +fi +if [[ $DPDK =~ "yes" ]]; then + setdpdk="-d" fi if [ -z $OVS_REPO_URL ]; then @@ -89,33 +107,24 @@ else echo Will use default kernel in ovs test vm fi +if [ -z $TAG ]; then + TAG=master +fi + if [ ! -z $DPDK ]; then setbuilddpdk="-d" fi if [ -z ${WORKSPACE+1} ]; then # We are not being run by Jenkins. - export WORKSPACE=$HOME/opnfv/ovsnfv - mkdir -p opnfv - cd opnfv - git clone https://git.opnfv.org/ovsnfv -fi - -export BUILD_BASE=$WORKSPACE/build - - - -if [ ! -d $BUILD_BASE ] -then - mkdir -p $BUILD_BASE + export WORKSPACE=`pwd` fi -if [ ! -f $BUILD_BASE/config ]; then - touch $BUILD_BASE/config +if [ -z ${BUILD_BASE+1} ]; then + export BUILD_BASE=$WORKSPACE fi -export PATH=$PATH:$WORKSPACE/ci:$BUILD_BASE -source $BUILD_BASE/config +export PATH=$PATH:$BUILD_BASE cd $BUILD_BASE export TOPDIR=$BUILD_BASE @@ -132,19 +141,35 @@ mkdir -p $RPMDIR/RPMS mkdir -p $RPMDIR/SOURCES mkdir -p $RPMDIR/SPECS mkdir -p $RPMDIR/SRPMS - - +# +# build dpdk rpm locally. +# +if [[ "$DPDK" =~ "yes" ]]; then + echo "===============================" + echo Build DPDK RPMs + echo + $BUILD_BASE/build_dpdk_rpm.sh -g $DPDK_VERSION +fi +# +# Build locally and copy RPMS +# +echo "===============================" +echo build OVS rpm locally +echo + ./build_ovs_rpm.sh $setnocheck -g $TAG $setdpdk $setkmod -p $OVS_PATCH -u $OVS_REPO_URL +# +# Test rpm +# if [ ! -z $TESTRPM ]; then - # Spawn VM to do the testing. - if [ ! -z $kernel_version ]; then - instack_ovs.sh -a $kernel_major -g $TAG -i $kernel_minor -p $OVS_PATCH -t -u $OVS_REPO_URL - else - instack_ovs.sh $setbuilddpdk -g $TAG -p $OVS_PATCH -t -u $OVS_REPO_URL - fi -else - # Run build locally. - build_ovs_rpm.sh $setbuilddpdk -g $TAG -p $OVS_PATCH -u $OVS_REPO_URL - cp $HOME/rpmbuild/RPMS/* $TMP_RELEASE_DIR + ./test_ovs_rpm.sh $setdpdk $setkmod fi +# +# If tests pass, copy rpms to release dir +# +echo "===============================" +echo copy rpms to release dir +echo +cp $RPMDIR/RPMS/x86_64/* $TMP_RELEASE_DIR + exit 0 |