3 IMAGE=juplo/simple-producer:1.0-SNAPSHOT
5 if [ "$1" = "cleanup" ]
7 docker-compose -f docker/docker-compose.yml down -t0 -v --remove-orphans
12 docker-compose -f docker/docker-compose.yml up -d --remove-orphans kafka-1 kafka-2 kafka-3
13 docker-compose -f docker/docker-compose.yml rm -svf producer
16 $(docker image ls -q $IMAGE) == "" ||
20 mvn clean install || exit
22 echo "Using image existing images:"
23 docker image ls $IMAGE
26 echo "Waiting for the Kafka-Cluster to become ready..."
27 docker-compose -f docker/docker-compose.yml run --rm cli cub kafka-ready -b kafka:9092 3 60 > /dev/null 2>&1 || exit 1
29 docker-compose -f docker/docker-compose.yml up -t0 -d cli
31 docker-compose -f docker/docker-compose.yml logs setup
33 docker-compose -f docker/docker-compose.yml ps
34 docker-compose -f docker/docker-compose.yml up -d producer
37 docker-compose -f docker/docker-compose.yml exec cli kafkacat -b kafka:9092 -t test -c 20 -f'topic=%t\tpartition=%p\toffset=%o\tkey=%k\tvalue=%s\n'
39 docker-compose -f docker/docker-compose.yml stop producer
40 docker-compose -f docker/docker-compose.yml exec cli kafkacat -b kafka:9092 -t test -e -f'topic=%t\tpartition=%p\toffset=%o\tkey=%k\tvalue=%s\n'
41 docker-compose -f docker/docker-compose.yml logs producer