-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreset.sh
executable file
·39 lines (31 loc) · 1.19 KB
/
reset.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
#!/bin/bash
source ./config.sh
sh ./stop.sh
sh ./third-party.sh stop
# Drop docker network
DOCKER_NETWORK_ID=$(docker network ls -qf name=^"${DOCKER_NETWORK_NAME}"$)
if [ -n "${DOCKER_NETWORK_ID}" ]; then
echo "Removing docker network..."
docker network rm "${DOCKER_NETWORK_NAME}"
fi
# Drop volumes
DOCKER_VOLUME_ID_API=$(docker volume ls -qf name=^"${DOCKER_VOLUME_NAME_API}"$)
if [ -n "${DOCKER_VOLUME_ID_API}" ]; then
echo "Removing docker core volume..."
docker volume rm "${DOCKER_VOLUME_NAME_API}"
fi
DOCKER_VOLUME_ID_TRAIN_MANAGER=$(docker volume ls -qf name=^"${DOCKER_VOLUME_NAME_TRAIN_MANAGER}"$)
if [ -z "${DOCKER_VOLUME_ID_TRAIN_MANAGER}" ]; then
echo "Removing docker train-manager volume..."
docker volume rm "${DOCKER_VOLUME_ID_TRAIN_MANAGER}"
fi
DOCKER_VOLUME_DB_ID=$(docker volume ls -qf name=^"${DOCKER_VOLUME_DB_NAME}"$)
if [ -n "${DOCKER_VOLUME_DB_ID}" ]; then
echo "Removing docker db volume..."
docker volume rm "${DOCKER_VOLUME_DB_NAME}"
fi
DOCKER_VOLUME_MQ_ID=$(docker volume ls -qf name=^"${DOCKER_VOLUME_MQ_NAME}"$)
if [ -n "${DOCKER_VOLUME_MQ_ID}" ]; then
echo "Removing docker rabbit-mq volume..."
docker volume rm "${DOCKER_VOLUME_MQ_NAME}"
fi