oslo.messaging/setup-test-env-kafka.sh
Andrew Smith 865ab522cb Update kafka and dsvm jobs
Depends-On: I3232378790cff0a956db204e99e34337bbe019ff
Change-Id: I913dde81a83937b355019abc428d21d44882a98f
2018-03-30 08:45:24 -04:00

21 lines
591 B
Bash
Executable File

#!/bin/bash
set -e
. tools/functions.sh
SCALA_VERSION=${SCALA_VERSION:-"2.12"}
KAFKA_VERSION=${KAFKA_VERSION:-"1.1.0"}
if [[ -z "$(which kafka-server-start)" ]] && [[ -z $(which kafka-server-start.sh) ]]; then
DATADIR=$(mktemp -d /tmp/OSLOMSG-KAFKA.XXXXX)
trap "clean_exit $DATADIR" EXIT
tarball=kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz
wget http://www.apache.org/dist/kafka/${KAFKA_VERSION}/$tarball -O $DATADIR/$tarball
tar -xzf $DATADIR/$tarball -C $DATADIR
export PATH=$DATADIR/kafka_${SCALA_VERSION}-${KAFKA_VERSION}/bin:$PATH
fi
pifpaf run kafka -- $*