-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstop_app.sh
More file actions
executable file
·76 lines (60 loc) · 1.94 KB
/
stop_app.sh
File metadata and controls
executable file
·76 lines (60 loc) · 1.94 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash -e
#######################################################################################################################
# This script stops the Curation application
#######################################################################################################################
# DEFAULT VARIABLES
EXP_TYPE=compose
DOCKER_PRUNE="0"
DIR=$(dirname $(readlink -f "$0"))
BUILD_DIR=$DIR/build
LONG_LIST=(
"type"
"prune"
)
OPTS=$(getopt \
--longoptions "$(printf "%s:," "${LONG_LIST[@]}")" \
--name "$(basename "$0")" \
--options "hpt:" \
-- "$@"
)
eval set -- $OPTS
#######################################################################################################################
# GET SCRIPT OPTIONS
script_usage()
{
cat <<EOF
This script stops the Video Curation Streaming Application
Usage: $0 [ options ]
Options:
-h optional Print this help message
-t or --type optional Deployment method (compose) [Default: compose]
-p or --prune optional Flag to prune docker builder
EOF
}
while true; do
case "$1" in
-h) script_usage; exit 0 ;;
-t | --type) shift; EXP_TYPE="$1"; shift ;;
-p | --prune) shift; DOCKER_PRUNE="1" ;;
--) shift; break ;;
*) script_usage; exit 0 ;;
esac
done
#######################################################################################################################
# STOP APP
cd $BUILD_DIR
if [ $EXP_TYPE == "compose" ]; then
make stop_docker_compose
# elif [ $EXP_TYPE == "k8" ]; then
# make stop_kubernetes
else
echo "INVALID TYPE: ${EXP_TYPE}"
fi
if [ $DOCKER_PRUNE == "1" ]; then
DOCKER_BUILDKIT=1 docker builder prune -f || true
docker container prune -f || true
docker volume rm lcc_app-content lcc_vdms-content || true # Verify volume is removed
docker volume prune -f || true
docker network prune -f || true
fi
cd $DIR