forked from spring-petclinic/spring-petclinic-microservices
-
Notifications
You must be signed in to change notification settings - Fork 6
/
start_all_with_inspectIT.sh
executable file
·87 lines (64 loc) · 2.82 KB
/
start_all_with_inspectIT.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
78
79
80
81
82
83
84
85
86
87
#!/bin/sh
#usage: ./start_all_with_inspectIT.sh <path to inspectIT agent> <CMR host>
#the startup scipt must be placed in the same folder than the spring petclinic microservice application
#the path to the inspectit installation folder and the waittime between the startup of the services
#!!!!do not use spaces in the path of the inspectIT installation folder!!!!
if [ "$#" -lt 1 ]; then
echo "Please specify the path to the inspectIT agent"
exit 1
fi
if [ "$#" -ne 2 ]; then
CMR_HOST="localhost"
else
CMR_HOST="$2"
fi
AGENTDIR="$1"
if [ -e "$AGENTDIR/inspectit-agent.jar" ]
then
echo "Agent jar found."
mvn clean install -DskipTests
cd spring-petclinic-config-server
echo "Starting Configuration Server"
mvn spring-boot:run &
cd ..
./wait-for-it.sh localhost:8888 --timeout=60
cd spring-petclinic-discovery-server
echo "Starting Discovery Server"
mvn spring-boot:run &
cd ..
./wait-for-it.sh localhost:8761 --timeout=60
xdg-open http://localhost:8761
cd spring-petclinic-customers-service
echo "Starting Customers Service"
mvn spring-boot:run -Drun.jvmArguments="-javaagent:${AGENTDIR}/inspectit-agent.jar -Dinspectit.repository=${CMR_HOST}:9070 -Dinspectit.agent.name=customers-service" &
cd ..
./wait-for-it.sh localhost:8761 --timeout=60
cd spring-petclinic-vets-service
echo "Starting Vets Service"
mvn spring-boot:run -Drun.jvmArguments="-javaagent:${AGENTDIR}/inspectit-agent.jar -Dinspectit.repository=${CMR_HOST}:9070 -Dinspectit.agent.name=vets-service" &
cd ..
./wait-for-it.sh localhost:8761 --timeout=60
cd spring-petclinic-visits-service
echo "Starting Visits Service"
mvn spring-boot:run -Drun.jvmArguments="-javaagent:${AGENTDIR}/inspectit-agent.jar -Dinspectit.repository=${CMR_HOST}:9070 -Dinspectit.agent.name=visits-service" &
cd ..
./wait-for-it.sh localhost:8761 --timeout=60
cd spring-petclinic-api-gateway
echo "Starting API Gateway"
mvn spring-boot:run -Drun.jvmArguments="-javaagent:${AGENTDIR}/inspectit-agent.jar -Dinspectit.repository=${CMR_HOST}:9070 -Dinspectit.agent.name=api-gateway" &
cd ..
./wait-for-it.sh localhost:8761 --timeout=60
cd spring-petclinic-admin-server
echo "Starting Admin Server"
mvn spring-boot:run -Drun.jvmArguments="-javaagent:${AGENTDIR}/inspectit-agent.jar -Dinspectit.repository=${CMR_HOST}:9070 -Dinspectit.agent.name=admin-server" &
cd ..
./wait-for-it.sh localhost:8080 --timeout=240
xdg-open http://localhost:8080
echo "All Services started!"
else
echo Agent jar not found. Specify the path to the inspectIT agent
echo Example: ./start_all_with_inspectIT.sh /home/user/inspectIT/agent
echo Optionally you can also specify the CMR_HOST as second arugment
echo Example: ./start_all_with_inspectIT.sh /home/user/inspectIT/agent localhost
echo In case you have not installed inspectIT go to https://github.com/inspectIT/inspectIT/releases
fi