forked from cer/microservices-examples
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-and-test-all.sh
executable file
·77 lines (50 loc) · 1.19 KB
/
build-and-test-all.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
73
74
75
76
77
#! /bin/bash
set -e
KEEP_RUNNING=
USE_EXISTING=
while [ ! -z "$*" ] ; do
case $1 in
"--keep-running" )
KEEP_RUNNING=yes
;;
"--use-existing" )
USE_EXISTING=yes
;;
"--help" )
echo ./build-and-test-all.sh --keep-running --use-existing
exit 0
;;
esac
shift
done
. ./set-env.sh
if [ -z "$USE_EXISTING" ] ; then
docker-compose down --remove-orphans
fi
docker-compose up -d rabbitmq mongodb
cd eureka-server
./gradlew build
cd ../zipkin-server
./gradlew build
cd ..
cd spring-boot-restful-service
./gradlew build
cd ..
docker-compose up -d --build restfulservice
echo -n waiting for restfulservice to start..
echo Launching RESTful service in Docker container
echo This takes about 30 seconds...
./wait-for-services.sh ${DOCKER_HOST_IP?} /health 8081
./wait-for-services.sh ${DOCKER_HOST_IP?} /eureka/apps/REGISTRATION-SERVICE 8761
cd spring-boot-webapp
export USER_REGISTRATION_URL=http://${DOCKER_HOST_IP?}:8081/user
./gradlew build
cd ..
docker-compose up -d --build web
./wait-for-running-system.sh
./register-user.sh
echo User registered
if [ -z "$KEEP_RUNNING" ] ; then
docker-compose down --remove-orphans
fi
echo Success