edouard@3425: #!/bin/bash
edouard@3425: 
edouard@3425: set -e
edouard@3425: 
edouard@3425: # source directory containing beremiz, matiec, etc..
edouard@3694: SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd ../../../.. && pwd )"
edouard@3425: echo "SOURCE direcory : $SRCDIR"
edouard@3425: 
edouard@3425: # absolute path to test directory. ~/test if not given as only argument
edouard@3425: TESTDIR=${1:-~/test}
edouard@3425: mkdir -p $TESTDIR
edouard@3425: echo "TEST direcory : $TESTDIR"
edouard@3425: 
edouard@3425: UNAME=testing
edouard@3425: UHOME=/home/$UNAME
edouard@3425: 
edouard@3435: # define TESTDEBUG in env to enable dev-mode. This enables :
edouard@3435: #   - debug pasthrough for Xnest
edouard@3435: #   - VNC port passthrough
edouard@3435: DEBUGARGS="-v /tmp/.X11-unix/X0:/tmp/.X11-unix/X0 -e DISPLAY=$DISPLAY -p 5900:5900"
edouard@3425: 
edouard@3425: echo "Creating docker container"
edouard@3425: docker create \
edouard@3425:        --name beremiz_sikuli_current \
edouard@3425:        -v $SRCDIR:$UHOME/src \
edouard@3425:        -v $TESTDIR:$UHOME/test \
edouard@3425:        `if [ "$TESTDEBUG" == "YES" ]; then echo $DEBUGARGS; fi` \
edouard@3425:        -w $UHOME/test \
edouard@3425:        -i -t beremiz_sikuli /bin/bash
edouard@3425: