You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

80 lines
1.6 KiB

#!/bin/bash -x
N_JOBS=2
TIMEOUT_MAC=1600
TIMEOUT_LINUX=2300
OS=$TRAVIS_OS_NAME
EXITCODE=42
# Skip this run?
if [ -f build/skip.txt ]
then
# Remove flag s.t. tests will be executed
if [[ "$1" == "BuildLast" ]]
then
rm build/skip.txt
fi
exit 0
fi
case $OS in
linux)
# Execute docker image on Linux
# Stop previous session
docker rm -f storm &>/dev/null
# Run container
set -e
case "$CONFIG" in
*DebugTravis)
docker run -d -it --name storm --privileged mvolk/carl:travis-debug
;;
*ReleaseTravis)
docker run -d -it --name storm --privileged mvolk/carl:travis
;;
*)
docker run -d -it --name storm --privileged mvolk/storm-basesystem:$LINUX
;;
esac
# Copy local content into container
docker exec storm mkdir opt/storm
docker cp . storm:/opt/storm
set +e
# Execute main process
timeout $TIMEOUT_LINUX docker exec storm bash -c "
export CONFIG=$CONFIG;
export COMPILER=$COMPILER;
export N_JOBS=$N_JOBS;
export STLARG=;
export OS=$OS;
cd /opt/storm;
travis/build_helper.sh $1"
EXITCODE=$?
;;
osx)
# Mac OSX
STLARG="-stdlib=libc++"
export CONFIG=$CONFIG
export COMPILER
export N_JOBS
export STLARG
export OS
gtimeout $TIMEOUT_MAC travis/build_helper.sh "$1"
EXITCODE=$?
;;
*)
# Unknown OS
echo "Unsupported OS: $OS"
exit 1
esac
if [[ $EXITCODE == 124 ]] && [[ "$1" == Build* ]] && [[ "$1" != "BuildLast" ]]
then
exit 0
else
exit $EXITCODE
fi