We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a69de8 commit 2a18eebCopy full SHA for 2a18eeb
download-kafka.sh
@@ -1,11 +1,11 @@
1
#!/bin/sh -e
2
3
-mirror=$(curl --stderr /dev/null 'https://www.apache.org/dyn/closer.cgi?as_json=1' | jq -r '.preferred')
+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)"')
5
-if [[ -z "$mirror" ]]; then
6
+if [[ -z "$url" ]]; then
7
echo "Unable to determine mirror for downloading Kafka, the service may be down"
8
exit 1
9
fi
10
-url="${mirror}kafka/${KAFKA_VERSION}/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz"
11
wget -q "${url}" -O "/tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz"
0 commit comments