3 FORTUNE=juplo/wordcount--fortune:1.0.0
4 RECORDER=juplo/wordcount--recorder:1.0.1
5 USERS=juplo/wordcount--users:1.0.4
6 SPLITTER=juplo/wordcount--splitter:1.0.0
7 COUNTER=juplo/wordcount--counter:1.1.0
8 TOP10=juplo/wordcount--top10:1.0.1
9 QUERY=juplo/wordcount--query:1.0.4
11 if [ "$1" = "cleanup" ]
13 docker-compose down -v --remove-orphans
14 docker image rm $FORTUNE
15 docker image rm $RECORDER
16 docker image rm $USERS
17 docker image rm $SPLITTER
18 docker image rm $COUNTER
19 docker image rm $TOP10
20 docker image rm $QUERY
25 $(docker image ls -q $FORTUNE) == "" ||
26 $(docker image ls -q $RECORDER) == "" ||
27 $(docker image ls -q $USERS) == "" ||
28 $(docker image ls -q $SPLITTER) == "" ||
29 $(docker image ls -q $COUNTER) == "" ||
30 $(docker image ls -q $TOP10) == "" ||
31 $(docker image ls -q $QUERY) == "" ||
35 mvn clean package || exit
36 docker-compose rm -svf recorder users splitter counter top10 query
37 ( cd fortune; ./README.sh $FORTUNE; )
38 mvn -f recorder/pom.xml docker:build
39 mvn -f users/pom.xml docker:build
40 mvn -f splitter/pom.xml docker:build
41 mvn -f counter/pom.xml docker:build
42 mvn -f top10/pom.xml docker:build
43 mvn -f query/pom.xml docker:build
45 echo "Using existing images:"
46 docker image ls $FORTUNE
47 docker image ls $RECORDER
48 docker image ls $USERS
49 docker image ls $SPLITTER
50 docker image ls $COUNTER
51 docker image ls $TOP10
52 docker image ls $QUERY
56 docker-compose up -d kafka cli traefik
58 echo "Waiting for the Kafka-Cluster to become ready..."
59 docker-compose exec cli cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1
61 docker-compose up -d users
62 while [ "$(http users.localhost/actuator/health 2> /dev/null | jq -r .status 2> /dev/null)" != "UP" ]; do echo "Waiting for service users..."; sleep 1; done
63 http -v post users.localhost username=bart firstName=Bart lastName=Simpson sex=MALE
64 http -v post users.localhost username=nerd firstName=Jane lastName=Doe sex=FEMALE
65 http -v post users.localhost username=riddler firstName=Rumpel lastName=Stilzchen sex=MALE
67 echo "Starting all instances..."
70 while [ "$(http query.localhost/actuator/health 2>/dev/null | jq -r .status 2> /dev/null)" != "UP" ]; do echo "Waiting for service query..."; sleep 1; done
71 http -v query.localhost/bart
73 http -v query.localhost/bart
75 http -v query.localhost/bart
77 http -v query.localhost/bart
79 http -v query.localhost/bart
81 http -v query.localhost/bart
83 http -v query.localhost/bart
84 http -v query.localhost/nerd
85 http -v query.localhost/riddler
87 // docker-compose up -d --scale query=5 query
88 http -v --follow query.localhost/bart
90 http -v --follow query.localhost/bart
92 http -v --follow query.localhost/bart
94 http -v --follow query.localhost/bart
96 http -v --follow query.localhost/bart
98 http -v --follow query.localhost/bart
100 http -v --follow query.localhost/bart
102 http -v --follow query.localhost/nerd
103 http -v --follow query.localhost/nerd
104 http -v --follow query.localhost/nerd
105 http -v --follow query.localhost/nerd
106 http -v --follow query.localhost/nerd
108 http -v --follow query.localhost/riddler
109 http -v --follow query.localhost/riddler
110 http -v --follow query.localhost/riddler
111 http -v --follow query.localhost/riddler
112 http -v --follow query.localhost/riddler