tests/tools/Docker/beremiz-sikuli/create_docker_container.sh
author Edouard Tisserant <edouard.tisserant@gmail.com>
Fri, 18 Feb 2022 15:12:06 +0100
branchwxPython4
changeset 3432 40b8b2ffb3fd
parent 3430 c2171d87b587
child 3435 c17155fd8573
permissions -rwxr-xr-x
Tests: Various enhancements in Makefile and sikuli common python code.
#!/bin/bash

set -e

# source directory containing beremiz, matiec, etc..
SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd ../../../../.. && pwd )"
echo "SOURCE direcory : $SRCDIR"

# absolute path to test directory. ~/test if not given as only argument
TESTDIR=${1:-~/test}
mkdir -p $TESTDIR
echo "TEST direcory : $TESTDIR"

UNAME=testing
UHOME=/home/$UNAME

# define TESTDEBUG in env to enable dev-mode debug pasthrough Xnest
DEBUGARGS="-v /tmp/.X11-unix/X0:/tmp/.X11-unix/X0 -e DISPLAY=$DISPLAY"

# In case VNC with x11vnc is prefered, then a port should be passed like this
# DEBUGARGS="-p 5900:5900"

echo "Creating docker container"
docker create \
       --name beremiz_sikuli_current \
       -v $SRCDIR:$UHOME/src \
       -v $TESTDIR:$UHOME/test \
       `if [ "$TESTDEBUG" == "YES" ]; then echo $DEBUGARGS; fi` \
       -w $UHOME/test \
       -i -t beremiz_sikuli /bin/bash