forked from jhipster/jhipster-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start_docker_compose.sh
executable file
·72 lines (68 loc) · 2.08 KB
/
start_docker_compose.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
71
72
#!/usr/bin/env bash
set -e
show_syntax() {
echo "Usage: $0 <folder>" >&2
exit 1
}
JHI_FOLDER_APP=$1
if [[ $JHI_FOLDER_APP == '' ]]; then
show_syntax
fi
#-------------------------------------------------------------------------------
# Start docker container
#-------------------------------------------------------------------------------
cd "$JHI_FOLDER_APP"
if [ -a src/main/docker/keycloak.yml ]; then
docker compose -f src/main/docker/keycloak.yml up -d
echo "*** wait 20sec"
sleep 20
fi
if [ -a src/main/docker/kafka.yml ]; then
docker compose -f src/main/docker/kafka.yml up -d
fi
if [ -a src/main/docker/consul.yml ]; then
docker compose -f src/main/docker/consul.yml up -d
fi
if [ -a src/main/docker/mongodb.yml ]; then
docker compose -f src/main/docker/mongodb.yml up -d
fi
if [ -a src/main/docker/redis.yml ]; then
docker compose -f src/main/docker/redis.yml up -d
fi
if [ -a src/main/docker/cassandra.yml ]; then
docker compose -f src/main/docker/cassandra.yml up -d
echo "*** wait until cassandra instance is UP"
retryCount=0
maxRetry=20
while ! docker exec cassandra cqlsh &>/dev/null && [ "$retryCount" -ne "$maxRetry" ]; do
echo " Cassandra not reachable yet. sleep and retry. retryCount =" $retryCount
sleep 5
((retryCount+=1))
done
fi
if [ -a src/main/docker/cassandra-migration.yml ]; then
docker compose -f src/main/docker/cassandra-migration.yml up -d
fi
if [ -a src/main/docker/mysql.yml ]; then
docker compose -f src/main/docker/mysql.yml up -d
fi
if [ -a src/main/docker/postgresql.yml ]; then
docker compose -f src/main/docker/postgresql.yml up -d
fi
if [ -a src/main/docker/mariadb.yml ]; then
docker compose -f src/main/docker/mariadb.yml up -d
fi
if [ -a src/main/docker/neo4j.yml ]; then
docker compose -f src/main/docker/neo4j.yml up -d
fi
if [ -a src/main/docker/mssql.yml ]; then
docker compose -f src/main/docker/mssql.yml up -d
echo "*** wait 40sec"
sleep 40
fi
if [ -a src/main/docker/jhipster-registry.yml ]; then
docker compose -f src/main/docker/jhipster-registry.yml up -d
fi
echo "*** wait 20sec"
sleep 20
docker ps -a