Files
MapLibreParticleLab/scripts/linux/run.sh
Konstantin Käfer f31b3d2ce5 build render binary
2015-05-12 15:15:05 +02:00

79 lines
2.2 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
set -o pipefail
BUILDTYPE=${BUILDTYPE:-Release}
source ./scripts/travis_helper.sh
# Add Mason to PATH
export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
# Set the core file limit to unlimited so a core file is generated upon crash
ulimit -c unlimited -S
################################################################################
# X Server setup
################################################################################
# Start the mock X server
if [ -f /etc/init.d/xvfb ] ; then
mapbox_time "start_xvfb" \
sh -e /etc/init.d/xvfb start
sleep 2 # sometimes, xvfb takes some time to start up
fi
# Make sure we're connecting to xvfb
export DISPLAY=:99.0
# Make sure we're loading the 10.4.3 libs we installed manually
export LD_LIBRARY_PATH="`mason prefix mesa 10.4.3`/lib:${LD_LIBRARY_PATH:-}"
mapbox_time "glxinfo" \
glxinfo
################################################################################
# Build
################################################################################
mapbox_time "checkout_styles" \
git submodule update --init styles
mapbox_time "compile_program" \
make linux -j${JOBS} BUILDTYPE=${BUILDTYPE}
mapbox_time "compile_render_binary" \
make render -j${JOBS} BUILDTYPE=${BUILDTYPE}
mapbox_time "compile_tests" \
make test -j${JOBS} BUILDTYPE=${BUILDTYPE}
################################################################################
# Test
################################################################################
mapbox_time "checkout_test_suite" \
git submodule update --init test/suite
mapbox_time "run_tests" \
make test-* BUILDTYPE=${BUILDTYPE}
mapbox_time "compare_results" \
./scripts/compare_images.sh
################################################################################
# Deploy
################################################################################
if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then
# Install and add awscli to PATH for uploading the results
mapbox_time "install_awscli" \
pip install --user awscli
export PATH="`python -m site --user-base`/bin:${PATH}"
mapbox_time_start "deploy_results"
(cd ./test/suite/ && ./bin/deploy_results.sh)
mapbox_time_finish
fi