-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose-down.sh
executable file
·67 lines (57 loc) · 1.42 KB
/
docker-compose-down.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
while getopts ":e:s:" opt; do
case $opt in
e) env="$OPTARG"
;;
s) ssl="$OPTARG"
;;
\?) echo "Invalid option -$OPTARG" >&2
;;
esac
done
# Defaults
if [ -z "$ssl" ]; then
ssl="true"
fi
if [ -z "$env" ]; then
env=".env"
fi
if [ $ssl = "false" ]
then
base_compose_path="./compose-non-ssl"
else
base_compose_path="./compose"
fi
printf "${BLUE}------------- Params${NC}"
echo ""
printf "${YELLOW}Enable ssl:${NC} $ssl"
echo ""
printf "${YELLOW}Base compose path:${NC} $base_compose_path"
echo ""
printf "${YELLOW}Environment variables path:${NC} $env"
echo ""
echo ""
printf "${BLUE}------------- Docker compose${NC}"
echo ""
printf "${YELLOW}Container Manager Stack${NC}"
echo ""
docker-compose -p "container-manager" -f ./compose/container-manager-compose.yaml --env-file "$env" down
echo ""
printf "${YELLOW}Media Stack${NC}"
echo ""
docker-compose -p "media" -f ./compose/media-compose.yaml --env-file "$env" down
echo ""
printf "${YELLOW}Monitoring Stack${NC}"
echo ""
docker-compose -p "monitoring" -f ./compose/monitoring-compose.yaml --env-file "$env" down
echo ""
printf "${YELLOW}Cloud Stack${NC}"
echo ""
docker-compose -p "cloud" -f "$base_compose_path/cloud-compose.yaml" --env-file "$env" down
echo ""
printf "${YELLOW}Network Stack${NC}"
echo ""
docker-compose -p "network" -f ./compose/network-compose.yaml --env-file "$env" down