-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·34 lines (27 loc) · 949 Bytes
/
Copy pathrun_tests.sh
File metadata and controls
executable file
·34 lines (27 loc) · 949 Bytes
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
33
#!/bin/bash
APP_PATH=$(pwd)/app
USERDATA_PATH=$(pwd)/examples/userdata.csv
MIRRORS_CONF_PATH=$(pwd)/examples/mirrors-apt.yaml
LISTEN_PORT=5000
CONTAINER_NAME=redirect_test
DETACH=false
##FIXME CHANGE CONFIG MAP TO YAML WHEN DONE
if [ ! -d "${APP_PATH}" ]; then
echo "Unable to find App path: ${APP_PATH}"
exit 1
fi
if [ ! -f "${USERDATA_PATH}" ]; then
echo "Unable to find userdata.csv at ${USERDATA_PATH}"
exit 1
fi
if [ ! -f "${MIRRORS_CONF_PATH}" ]; then
echo "Unable to find mirrors.yaml at ${MIRRORS_CONF_PATH}"
exit 1
fi
sudo docker run --rm $([[ ${DETACH} == "true" ]] && echo "-d") \
-v ${APP_PATH}:/app \
-v ${USERDATA_PATH}:/app/userdata.csv \
-v ${MIRRORS_CONF_PATH}:/app/mirrors.yaml \
-p ${LISTEN_PORT}:80 \
--name ${CONTAINER_NAME} \
quay.io/lanefu/nginx-uwsgi-flask:arm64 bash -c "pip install --upgrade pip && pip install -r requirements.txt && pip install pytest && pytest -s "