forked from vircadia/vircadia-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_test
executable file
·34 lines (28 loc) · 845 Bytes
/
run_test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
container="$1"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
if [ -z "$container" ] ; then
echo "Syntax: $0 [container]"
echo ""
echo "Suggested containers"
echo "--------------------"
podman image list --noheading | grep 'vircadia-builder/'
exit 1
else
shift
fi
cmd="/builder/test-helpers/try_build"
if [ -x "$SCRIPT_DIR/test-helpers/$container" ] ; then
echo "Using helper script for $container"
cmd="/builder/test-helpers/$container"
fi
if [ -x "/usr/bin/podman" ] ; then
echo "Running test for $container with podman"
podman run -it -v .:/builder:Z "$container" "$cmd" --auto "$@"
elif [ -x "/usr/bin/docker" ] ; then
echo "Running test for $container with docker"
docker run -it -v .:/builder "$container" "$cmd" --auto "$@"
else
echo "Podman or docker is required!"
exit 1
fi