Skip to content

Commit

Permalink
build: Use errtrace to simplify travis-ci failure detection
Browse files Browse the repository at this point in the history
Causes the build script to fail if any command inside the
script returns nonzero.

Signed-off-by: Thomas Graf <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
Thomas Graf authored and blp committed Aug 26, 2014
1 parent 0bc1b46 commit de0ae68
Showing 1 changed file with 20 additions and 23 deletions.
43 changes: 20 additions & 23 deletions .travis/build.sh
Original file line number Diff line number Diff line change
@@ -1,40 +1,37 @@
#!/bin/bash

set -o errexit

KERNELSRC=""

function install_kernel()
{
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.7.tar.gz \
&& tar xzvf linux-3.14.7.tar.gz > /dev/null \
&& cd linux-3.14.7 \
&& make allmodconfig \
&& make net/openvswitch/ \
&& KERNELSRC=$(pwd) \
&& echo "Installed kernel source in $(pwd)" \
&& cd ..

[ $? != 0 ] && exit 1
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.7.tar.gz
tar xzvf linux-3.14.7.tar.gz > /dev/null
cd linux-3.14.7
make allmodconfig
make net/openvswitch/
KERNELSRC=$(pwd)
echo "Installed kernel source in $(pwd)"
cd ..
}

function install_dpdk()
{
wget http://www.dpdk.org/browse/dpdk/snapshot/dpdk-1.7.0.tar.gz \
&& tar xzvf dpdk-1.7.0.tar.gz > /dev/null \
&& cd dpdk-1.7.0 \
&& find ./ -type f | xargs sed -i 's/max-inline-insns-single=100/max-inline-insns-single=400/' \
&& make config CC=gcc T=x86_64-native-linuxapp-gcc \
&& make CC=gcc RTE_KERNELDIR=$KERNELSRC \
&& sudo make install CC=gcc T=x86_64-native-linuxapp-gcc RTE_KERNELDIR=$KERNELSRC \
&& echo "Installed DPDK source in $(pwd)" \
&& cd ..

[ $? != 0 ] && exit 1
wget http://www.dpdk.org/browse/dpdk/snapshot/dpdk-1.7.0.tar.gz
tar xzvf dpdk-1.7.0.tar.gz > /dev/null
cd dpdk-1.7.0
find ./ -type f | xargs sed -i 's/max-inline-insns-single=100/max-inline-insns-single=400/'
make config CC=gcc T=x86_64-native-linuxapp-gcc
make CC=gcc RTE_KERNELDIR=$KERNELSRC
sudo make install CC=gcc T=x86_64-native-linuxapp-gcc RTE_KERNELDIR=$KERNELSRC
echo "Installed DPDK source in $(pwd)"
cd ..
}

function configure_ovs()
{
./boot.sh && ./configure $*
[ $? != 0 ] && exit 1
}

if [ "$KERNEL" ] || [ "$DPDK" ]; then
Expand All @@ -48,7 +45,7 @@ configure_ovs $*
if [ $CC = "clang" ]; then
make CFLAGS="-Werror -Wno-error=unused-command-line-argument"
else
make CFLAGS="-Werror" C=1 || exit 1
make CFLAGS="-Werror" C=1
[ "$TESTSUITE" ] && make check
fi

Expand Down

0 comments on commit de0ae68

Please sign in to comment.