From: Kai Moritz Date: Fri, 1 Apr 2022 11:41:14 +0000 (+0200) Subject: Korrekturen des README-Skriptes auf first-contact übernommen X-Git-Tag: acks-KAPUTT-DEPRECATED~9 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=efa942341314e29f68b895ad4c8cee766c895236;p=demos%2Fkafka%2Ftraining Korrekturen des README-Skriptes auf first-contact übernommen --- efa942341314e29f68b895ad4c8cee766c895236 diff --cc README.sh index 0544297,0ee50a9..73ceebc --- a/README.sh +++ b/README.sh @@@ -9,23 -7,27 +9,23 @@@ the exit fi -mvn package || exit 1 -if [ "$1" = "build" ]; then exit; fi - -trap 'kill $(jobs -p) 2>/dev/null' EXIT +docker-compose up -d zookeeper kafka cli -docker-compose up -d +if [[ + $(docker image ls -q $IMAGE) == "" || + "$1" = "build" +]] +then + mvn install || exit +else + echo "Using image existing images:" + docker image ls $IMAGE +fi echo "Waiting for the Kafka-Cluster to become ready..." - docker-compose exec kafka cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1 + docker-compose exec cli cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1 - -echo "Producing messages" -mvn exec:java@producer - -echo "Reading messages" -mvn exec:java@consumer & -sleep 7 -kill $(jobs -p) -sleep 2 - -echo "Re-Reading messages" -mvn exec:java@consumer & -sleep 7 -kill $(jobs -p) -sleep 2 +docker-compose up setup +docker-compose up -d producer +sleep 5 +docker-compose stop producer +docker-compose logs producer