Skip to content

Commit 2a18eeb

Browse files
mielmatsscaling
authored andcommitted
Specify required path for kafka download mirror selection (wurstmeister#318)
Fixes wurstmeister#310
1 parent 6a69de8 commit 2a18eeb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

download-kafka.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/sh -e
22

3-
mirror=$(curl --stderr /dev/null 'https://www.apache.org/dyn/closer.cgi?as_json=1' | jq -r '.preferred')
3+
path="kafka/${KAFKA_VERSION}/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz"
4+
url=$(curl --stderr /dev/null "https://www.apache.org/dyn/closer.cgi?path=/${path}&as_json=1" | jq -r '"\(.preferred)\(.path_info)"')
45

5-
if [[ -z "$mirror" ]]; then
6+
if [[ -z "$url" ]]; then
67
echo "Unable to determine mirror for downloading Kafka, the service may be down"
78
exit 1
89
fi
910

10-
url="${mirror}kafka/${KAFKA_VERSION}/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz"
1111
wget -q "${url}" -O "/tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz"

0 commit comments

Comments
 (0)