forked from needlehack-team/needlehack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·38 lines (32 loc) · 956 Bytes
/
run.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
#!/bin/bash
cd docker
docker-compose down
docker-compose rm -f
docker-compose up --build -d
function checkContainerIsHealthy(){
while [ true ]; do
if [ $(docker inspect --format="{{json .State.Health.Status }}" "$1") == "healthy" ]; then
echo "$1 is healthy. :D"
break
else
echo "$1 is not healthy. Sleep for 5 second"
sleep 5
break
fi
done
}
checkContainerIsHealthy elasticsearch
checkContainerIsHealthy kibana
echo "**********************************************************************************"
echo "************************** All containers are ready! :) **************************"
echo "**********************************************************************************"
cd ..
if [[ $1 == "debug" ]]; then
echo ""
echo "You can run the applications in debug mode :) "
else
cd collector
mvn spring-boot:run &
cd ..
fi
exit 0