2017-01-08 14:45:28 -04:00
|
|
|
#! /bin/bash
|
|
|
|
|
2017-01-14 10:38:28 -04:00
|
|
|
if [ -z "$PX4_DOCKER_REPO" ]; then
|
|
|
|
PX4_DOCKER_REPO=px4io/px4-dev-nuttx:2017-01-14
|
|
|
|
fi
|
|
|
|
|
2017-01-08 14:45:28 -04:00
|
|
|
PWD=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
|
|
|
SRC_DIR=$PWD/../
|
|
|
|
|
|
|
|
CCACHE_DIR=${HOME}/.ccache
|
|
|
|
mkdir -p ${CCACHE_DIR}
|
|
|
|
|
2017-01-14 10:38:28 -04:00
|
|
|
X11_TMP=/tmp/.X11-unix
|
|
|
|
|
2017-01-08 14:45:28 -04:00
|
|
|
docker run -it --rm -w ${SRC_DIR} \
|
2017-01-14 10:38:28 -04:00
|
|
|
-e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
|
|
|
|
-e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
|
2017-01-08 14:45:28 -04:00
|
|
|
-e CCACHE_DIR=${CCACHE_DIR} \
|
2017-01-14 10:38:28 -04:00
|
|
|
-e CI=${CI} \
|
|
|
|
-e DISPLAY=$DISPLAY \
|
|
|
|
-e GIT_SUBMODULES_ARE_EVIL=1 \
|
2017-01-08 14:45:28 -04:00
|
|
|
-e LOCAL_USER_ID=`id -u` \
|
2017-01-14 10:38:28 -04:00
|
|
|
-e TRAVIS_BRANCH=${TRAVIS_BRANCH} \
|
|
|
|
-e TRAVIS_BUILD_ID=${TRAVIS_BUILD_ID} \
|
|
|
|
-v ${CCACHE_DIR}:${CCACHE_DIR}:rw \
|
|
|
|
-v ${SRC_DIR}:${SRC_DIR}:rw \
|
|
|
|
-v ${X11_TMP}:${X11_TMP}:ro \
|
|
|
|
${PX4_DOCKER_REPO} /bin/bash -c "$@"
|