File: setup-test-env-kafka.sh

package info (click to toggle)
python-oslo.messaging 10.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,640 kB
  • sloc: python: 14,376; sh: 88; makefile: 24
file content (20 lines) | stat: -rwxr-xr-x 595 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
set -e

. tools/functions.sh

SCALA_VERSION=${SCALA_VERSION:-"2.12"}
KAFKA_VERSION=${KAFKA_VERSION:-"2.0.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://archive.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 -- $*