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 docker-compose -f docker/docker-compose.yml up --remove-orphans setup || exit 1
28 docker-compose -f docker/docker-compose.yml up -t0 -d cli
30 docker-compose -f docker/docker-compose.yml logs setup
32 docker-compose -f docker/docker-compose.yml ps
33 docker-compose -f docker/docker-compose.yml up -d producer
36 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'
38 docker-compose -f docker/docker-compose.yml stop producer
39 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'
40 docker-compose -f docker/docker-compose.yml logs producer