tests/tools/Docker/create_docker_container.sh
author Edouard Tisserant <edouard.tisserant@gmail.com>
Fri, 03 Mar 2023 09:47:39 +0100
branchwxPython4
changeset 3739 99263915a91d
parent 3694 129b8e32f5bb
permissions -rwxr-xr-x
Fix typo in toolchain_gcc.py : LDLAGS -> LDFLAGS
3425
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     1
#!/bin/bash
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     2
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     3
set -e
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     4
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     5
# source directory containing beremiz, matiec, etc..
3694
129b8e32f5bb Tests: fix path logic in Docker creation script, consequence of previous commit.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3693
diff changeset
     6
SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd ../../../.. && pwd )"
3425
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     7
echo "SOURCE direcory : $SRCDIR"
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     8
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     9
# absolute path to test directory. ~/test if not given as only argument
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    10
TESTDIR=${1:-~/test}
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    11
mkdir -p $TESTDIR
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    12
echo "TEST direcory : $TESTDIR"
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    13
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    14
UNAME=testing
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    15
UHOME=/home/$UNAME
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    16
3435
c17155fd8573 Tests: re-introduce xvfb+x11vnc target in Makefile : xvfb_sikuli
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3430
diff changeset
    17
# define TESTDEBUG in env to enable dev-mode. This enables :
c17155fd8573 Tests: re-introduce xvfb+x11vnc target in Makefile : xvfb_sikuli
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3430
diff changeset
    18
#   - debug pasthrough for Xnest
c17155fd8573 Tests: re-introduce xvfb+x11vnc target in Makefile : xvfb_sikuli
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3430
diff changeset
    19
#   - VNC port passthrough
c17155fd8573 Tests: re-introduce xvfb+x11vnc target in Makefile : xvfb_sikuli
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3430
diff changeset
    20
DEBUGARGS="-v /tmp/.X11-unix/X0:/tmp/.X11-unix/X0 -e DISPLAY=$DISPLAY -p 5900:5900"
3425
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    21
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    22
echo "Creating docker container"
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    23
docker create \
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    24
       --name beremiz_sikuli_current \
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    25
       -v $SRCDIR:$UHOME/src \
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    26
       -v $TESTDIR:$UHOME/test \
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    27
       `if [ "$TESTDEBUG" == "YES" ]; then echo $DEBUGARGS; fi` \
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    28
       -w $UHOME/test \
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    29
       -i -t beremiz_sikuli /bin/bash
ee3b84d09ccf Add Docker image definition as reference platform to run IDE tests.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    30