utils/create-topic.sh in phobos-1.4.2 vs utils/create-topic.sh in phobos-1.5.0
- old
+ new
@@ -1,17 +1,13 @@
#!/bin/bash
set -eu
-UTILS_DIR=$(dirname $0)
-source ${UTILS_DIR}/env.sh
-
-ZK_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' zookeeper)
TOPIC=${TOPIC:='test'}
PARTITIONS=${PARTITIONS:=2}
echo "creating topic ${TOPIC}, partitions ${PARTITIONS}"
-docker run --rm $KAFKA_IMAGE:$KAFKA_IMAGE_VERSION kafka-topics.sh \
- --create \
+docker-compose run --rm -e PARTITIONS=$PARTITIONS -e TOPIC=$TOPIC kafka kafka-topics.sh --create \
--topic $TOPIC \
--replication-factor 1 \
--partitions $PARTITIONS \
- --zookeeper $ZK_IP:2181
+ --zookeeper zookeeper:2181 \
+ 2>/dev/null