Skip to content

Commit

Permalink
fix(risedevtool): try download kafka from archive.apache if downloads…
Browse files Browse the repository at this point in the history
….apache does not work (#10414)

Co-authored-by: lmatz <lmatz823@gmail.com>
  • Loading branch information
kwannoel and lmatz authored Jun 19, 2023
1 parent ca45ad2 commit 767cb48
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/risedevtool/kafka.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ KAFKA_DOWNLOAD_PATH = "${PREFIX_TMP}/kafka.tgz"
KAFKA_VERSION = "3.4.1"
KAFKA_SCALA_VERSION = "2.13"
KAFKA_RELEASE = "kafka_${KAFKA_SCALA_VERSION}-${KAFKA_VERSION}"
KAFKA_DOWNLOAD_TGZ = "https://dlcdn.apache.org/kafka/${KAFKA_VERSION}/kafka_${KAFKA_SCALA_VERSION}-${KAFKA_VERSION}.tgz"
KAFKA_DOWNLOAD_RECENT_TGZ = "https://downloads.apache.org/kafka/${KAFKA_VERSION}/kafka_${KAFKA_SCALA_VERSION}-${KAFKA_VERSION}.tgz"
KAFKA_DOWNLOAD_ARCHIVE_TGZ = "https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_${KAFKA_SCALA_VERSION}-${KAFKA_VERSION}.tgz"

[tasks.download-kafka]
category = "RiseDev - Components"
Expand All @@ -19,7 +20,8 @@ if [ -d "${PREFIX_BIN}/kafka" ]; then
exit 0
fi
echo "Kafka not found, download ${KAFKA_RELEASE}"
curl -fL -o "${KAFKA_DOWNLOAD_PATH}" "${KAFKA_DOWNLOAD_TGZ}"
curl -fL -o "${KAFKA_DOWNLOAD_PATH}" "${KAFKA_DOWNLOAD_RECENT_TGZ}" \
|| curl -fL -o "${KAFKA_DOWNLOAD_PATH}" "${KAFKA_DOWNLOAD_ARCHIVE_TGZ}"
tar -xf "${KAFKA_DOWNLOAD_PATH}" -C "${PREFIX_TMP}"
mv "${PREFIX_TMP}/${KAFKA_RELEASE}" "${PREFIX_BIN}/kafka"
rm ${KAFKA_DOWNLOAD_PATH}
Expand Down

0 comments on commit 767cb48

Please sign in to comment.