forked from pwndoc/pwndoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests.sh
executable file
·54 lines (48 loc) · 1.11 KB
/
run_tests.sh
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
function usage {
echo "Usage: $0 -q|-f [-h, --help]"
echo ""
echo "Options:"
echo " -h, --help Display help"
echo " -q Run quick tests (No build)"
echo " -f Run full tests (Build with no cache)"
exit 1
}
function full_test {
docker-compose down
rm -rf backend/mongo-data
docker-compose build --no-cache
docker-compose up -d
docker-compose -f backend/docker-compose.test.yml build
docker-compose -f backend/docker-compose.test.yml run --rm backend-test
rc=$?
docker-compose down
rm -rf backend/mongo-data
exit $rc
}
function quick_test {
docker-compose stop
rm -rf backend/mongo-data
docker-compose start
docker-compose -f backend/docker-compose.test.yml run --rm backend-test
rc=$?
exit $rc
}
while getopts "hqf" option
do
case $option in
h|--help)
usage
;;
q|--quick)
quick_test
;;
f|--full)
full_test
;;
*)
usage
;;
esac
done
if [ $OPTIND -eq 1 ]; then usage; fi