-
Notifications
You must be signed in to change notification settings - Fork 110
/
docker-compose-ZOOKEEPER.sh
executable file
·62 lines (49 loc) · 1.72 KB
/
docker-compose-ZOOKEEPER.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
#!/bin/bash
# -Dspring.profiles.active=deps <-- remove this profile
SYSTEM_PROPS="-DRABBIT_HOST=${HEALTH_HOST} -Dspring.rabbitmq.port=5672"
dockerComposeFile="docker-compose-${WHAT_TO_TEST}.yml"
kill_docker
docker-compose -f $dockerComposeFile kill
docker-compose -f $dockerComposeFile pull
if [[ "${SHOULD_START_RABBIT}" == "yes" ]] ; then
echo -e "\n\nBooting up RabbitMQ"
docker-compose -f $dockerComposeFile up -d rabbitmq
fi
READY_FOR_TESTS="no"
PORT_TO_CHECK=5672
echo "Waiting for RabbitMQ to boot for [$(( WAIT_TIME * RETRIES ))] seconds"
netcat_port $PORT_TO_CHECK && READY_FOR_TESTS="yes"
if [[ "${READY_FOR_TESTS}" == "no" ]] ; then
echo "RabbitMQ failed to start..."
exit 1
fi
READY_FOR_TESTS="no"
PORT_TO_CHECK=2181
echo "Waiting for Zookeeper to boot for [$(( WAIT_TIME * RETRIES ))] seconds"
docker-compose -f $dockerComposeFile up -d zookeeper
netcat_local_port $PORT_TO_CHECK && READY_FOR_TESTS="yes"
if [[ "${READY_FOR_TESTS}" == "no" ]] ; then
echo "Zookeeper failed to start..."
exit 1
fi
READY_FOR_TESTS="no"
PORT_TO_CHECK=3100
echo "Run the rest of infra"
docker-compose -f $dockerComposeFile up -d zipkin loki prometheus grafana
netcat_local_port $PORT_TO_CHECK && READY_FOR_TESTS="yes"
if [[ "${READY_FOR_TESTS}" == "no" ]] ; then
echo "Loki failed to start..."
exit 1
fi
# Boot config-server
READY_FOR_TESTS="no"
PORT_TO_CHECK=8888
echo "Waiting for the Config Server app to boot for [$(( WAIT_TIME * RETRIES ))] seconds"
java_jar "config-server"
curl_local_health_endpoint $PORT_TO_CHECK && READY_FOR_TESTS="yes"
if [[ "${READY_FOR_TESTS}" == "no" ]] ; then
echo "Config server failed to start..."
exit 1
fi
echo -e "\n\nStarting brewery apps..."
start_brewery_apps "$SYSTEM_PROPS"