diff options
author | vagrant <vagrant@vagrant.vm> | 2014-08-13 22:01:29 -0700 |
---|---|---|
committer | vagrant <vagrant@vagrant.vm> | 2014-08-13 22:15:03 -0700 |
commit | 813a0bdaa2e4ca6ae68ad83e42dc926f4f953737 (patch) | |
tree | 27a0db7049915ffa6ab6b83fb29cf872702aa57b /build_integration.sh | |
parent | a6200f2e998c9cc17ca5f247798478a84956a2e2 (diff) | |
download | kafka-python-813a0bdaa2e4ca6ae68ad83e42dc926f4f953737.tar.gz |
Support integration testing against kafka source builds (see README)
Diffstat (limited to 'build_integration.sh')
-rwxr-xr-x | build_integration.sh | 57 |
1 files changed, 45 insertions, 12 deletions
diff --git a/build_integration.sh b/build_integration.sh index 0166de7..bb46e54 100755 --- a/build_integration.sh +++ b/build_integration.sh @@ -1,26 +1,59 @@ #!/bin/bash +# Versions available for testing via binary distributions +OFFICIAL_RELEASES="0.8.0 0.8.1 0.8.1.1" + +# Useful configuration vars, with sensible defaults if [ -z "$SCALA_VERSION" ]; then SCALA_VERSION=2.8.0 fi -if [ -z "$KAFKA_VERSION" && -z "$TRAVIS" ]; then - KAFKA_VERSION="0.8.0 0.8.1 0.8.1.1" + +# On travis CI, empty KAFKA_VERSION means skip integration tests +# so we dont try to get binaries +# Otherwise it means test all official releases, so we get all of them! +if [ -z "$KAFKA_VERSION" -a -z "$TRAVIS" ]; then + KAFKA_VERSION=$OFFICIAL_RELEASES fi + +# By default look for binary releases at archive.apache.org +if [ -z "$DIST_BASE_URL" ]; then + DIST_BASE_URL="https://archive.apache.org/dist/kafka/" +fi + +# When testing against source builds, use this git repo +if [ -z "$KAFKA_SRC_GIT" ]; then + KAFKA_SRC_GIT="https://github.com/apache/kafka.git" +fi + pushd servers mkdir -p dist pushd dist for kafka in $KAFKA_VERSION; do - echo "-------------------------------------" - echo "Checking kafka binaries for v${kafka}" - echo - wget -N https://archive.apache.org/dist/kafka/$kafka/kafka_${SCALA_VERSION}-${kafka}.tgz || wget -N https://archive.apache.org/dist/kafka/$kafka/kafka_${SCALA_VERSION}-${kafka}.tar.gz - echo - if [ ! -d "../$kafka/kafka-bin" ]; then - echo "Extracting kafka binaries for v${kafka}" - tar xzvf kafka_${SCALA_VERSION}-${kafka}.t* -C ../$kafka/ - mv ../$kafka/kafka_${SCALA_VERSION}-${kafka} ../$kafka/kafka-bin + if [ "$kafka" == "trunk" ]; then + if [ ! -d "$kafka" ]; then + git clone $KAFKA_SRC_GIT $kafka + fi + pushd $kafka + git pull + ./gradlew -PscalaVersion=$SCALA_VERSION -Pversion=$kafka releaseTarGz -x signArchives + popd + # Not sure how to construct the .tgz name accurately, so use a wildcard (ugh) + tar xzvf $kafka/core/build/distributions/kafka_*.tgz -C ../$kafka/ + rm $kafka/core/build/distributions/kafka_*.tgz + mv ../$kafka/kafka_* ../$kafka/kafka-bin else - echo "$kafka/kafka-bin directory already exists -- skipping tgz extraction" + echo "-------------------------------------" + echo "Checking kafka binaries for ${kafka}" + echo + wget -N https://archive.apache.org/dist/kafka/$kafka/kafka_${SCALA_VERSION}-${kafka}.tgz || wget -N https://archive.apache.org/dist/kafka/$kafka/kafka_${SCALA_VERSION}-${kafka}.tar.gz + echo + if [ ! -d "../$kafka/kafka-bin" ]; then + echo "Extracting kafka binaries for ${kafka}" + tar xzvf kafka_${SCALA_VERSION}-${kafka}.t* -C ../$kafka/ + mv ../$kafka/kafka_${SCALA_VERSION}-${kafka} ../$kafka/kafka-bin + else + echo "$kafka/kafka-bin directory already exists -- skipping tgz extraction" + fi fi echo done |