-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sh
72 lines (61 loc) · 2.37 KB
/
init.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
68
69
70
#!/bin/bash
source ./config.sh
# Create docker network
DOCKER_NETWORK_ID=$(docker network ls -qf name=^"${DOCKER_NETWORK_NAME}"$)
if [ -z "${DOCKER_NETWORK_ID}" ]; then
echo "Creating docker network..."
docker network create "${DOCKER_NETWORK_NAME}"
else
echo "Docker network already exists."
fi
if [[ "${ENABLED_API}" == true ]]; then
# Creating volumes
DOCKER_VOLUME_ID_API=$(docker volume ls -qf name=^"${DOCKER_VOLUME_NAME_API}"$)
if [ -z "${DOCKER_VOLUME_ID_API}" ]; then
echo "Creating docker core volume..."
docker volume create "${DOCKER_VOLUME_NAME_API}"
fi
fi
if [[ "${ENABLED_TRAIN_MANAGER}" == true ]]; then
# Creating volumes
DOCKER_VOLUME_ID_TRAIN_MANAGER=$(docker volume ls -qf name=^"${DOCKER_VOLUME_NAME_TRAIN_MANAGER}"$)
if [ -z "${DOCKER_VOLUME_ID_TRAIN_MANAGER}" ]; then
echo "Creating docker train-manager volume..."
docker volume create "${DOCKER_VOLUME_NAME_API}"
fi
fi
if [[ "${AUTHUP_ENABLED}" == true ]]; then
DOCKER_VOLUME_AUTHUP_ID=$(docker volume ls -qf name=^"${DOCKER_VOLUME_AUTHUP_NAME}"$)
if [ -z "${DOCKER_VOLUME_AUTHUP_ID}" ]; then
echo "Creating docker auth volume..."
docker volume create "${DOCKER_VOLUME_AUTHUP_NAME}"
fi
fi
if [[ "${DB_ENABLED}" == true ]]; then
DOCKER_VOLUME_DB_ID=$(docker volume ls -qf name=^"${DOCKER_VOLUME_DB_NAME}"$)
if [ -z "${DOCKER_VOLUME_DB_ID}" ]; then
echo "Creating docker db volume..."
docker volume create "${DOCKER_VOLUME_DB_NAME}"
fi
fi
if [[ "${MQ_ENABLED}" == true ]]; then
DOCKER_VOLUME_MQ_ID=$(docker volume ls -qf name=^"${DOCKER_VOLUME_MQ_NAME}"$)
if [ -z "${DOCKER_VOLUME_MQ_ID}" ]; then
echo "Creating docker rabbit-mq volume..."
docker volume create "${DOCKER_VOLUME_MQ_NAME}"
fi
fi
if [[ "${MINIO_ENABLED}" == true ]]; then
DOCKER_VOLUME_MINIO_ID=$(docker volume ls -qf name=^"${DOCKER_VOLUME_MINIO_NAME}"$)
if [ -z "${DOCKER_VOLUME_MINIO_ID}" ]; then
echo "Creating docker minio volume..."
docker volume create "${DOCKER_VOLUME_MINIO_NAME}"
fi
fi
if [[ "${VAULT_ENABLED}" == true ]]; then
DOCKER_VOLUME_VAULT_ID=$(docker volume ls -qf name=^"${DOCKER_VOLUME_VAULT_NAME}"$)
if [ -z "${DOCKER_VOLUME_VAULT_ID}" ]; then
echo "Creating docker vault volume..."
docker volume create "${DOCKER_VOLUME_VAULT_NAME}"
fi
fi