2021-10-12 20:03:20 +00:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
OS=$(uname -s)
|
|
|
|
ARCH=$(uname -m)
|
|
|
|
|
|
|
|
DIR=
|
|
|
|
|
|
|
|
if [ "${OS}" = "Linux" ]
|
|
|
|
then
|
|
|
|
if [ "${ARCH}" = "x86_64" ]
|
|
|
|
then
|
|
|
|
DIR="amd64"
|
|
|
|
elif [ "${ARCH}" = "aarch64" ]
|
|
|
|
then
|
|
|
|
DIR="aarch64"
|
|
|
|
elif [ "${ARCH}" = "powerpc64le" ]
|
|
|
|
then
|
|
|
|
DIR="powerpc64le"
|
|
|
|
fi
|
|
|
|
elif [ "${OS}" = "FreeBSD" ]
|
|
|
|
then
|
|
|
|
if [ "${ARCH}" = "x86_64" ]
|
|
|
|
then
|
|
|
|
DIR="freebsd"
|
|
|
|
elif [ "${ARCH}" = "aarch64" ]
|
|
|
|
then
|
2021-10-12 22:59:12 +00:00
|
|
|
DIR="freebsd-aarch64"
|
2021-10-12 20:03:20 +00:00
|
|
|
elif [ "${ARCH}" = "powerpc64le" ]
|
|
|
|
then
|
2021-10-12 22:59:12 +00:00
|
|
|
DIR="freebsd-powerpc64le"
|
2021-10-12 20:03:20 +00:00
|
|
|
fi
|
|
|
|
elif [ "${OS}" = "Darwin" ]
|
|
|
|
then
|
|
|
|
if [ "${ARCH}" = "x86_64" ]
|
|
|
|
then
|
|
|
|
DIR="macos"
|
2021-11-09 20:14:10 +00:00
|
|
|
elif [ "${ARCH}" = "aarch64" -o "${ARCH}" = "arm64" ]
|
2021-10-12 20:03:20 +00:00
|
|
|
then
|
|
|
|
DIR="macos-aarch64"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "${DIR}" ]
|
|
|
|
then
|
|
|
|
echo "The '${OS}' operating system with the '${ARCH}' architecture is not supported."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
URL="https://builds.clickhouse.com/master/${DIR}/clickhouse"
|
2021-10-17 02:52:00 +00:00
|
|
|
echo
|
2021-10-12 20:03:20 +00:00
|
|
|
echo "Will download ${URL}"
|
2021-10-17 02:52:00 +00:00
|
|
|
echo
|
2021-10-31 21:42:13 +00:00
|
|
|
curl -O "${URL}" && chmod a+x clickhouse || exit 1
|
2021-10-17 02:52:00 +00:00
|
|
|
echo
|
2021-10-12 20:03:20 +00:00
|
|
|
echo "Successfully downloaded the ClickHouse binary, you can run it as:
|
|
|
|
./clickhouse"
|
|
|
|
|
|
|
|
if [ "${OS}" = "Linux" ]
|
|
|
|
then
|
2021-10-17 02:52:00 +00:00
|
|
|
echo
|
2021-10-12 20:03:20 +00:00
|
|
|
echo "You can also install it:
|
2021-10-12 20:09:26 +00:00
|
|
|
sudo ./clickhouse install"
|
2021-10-12 20:03:20 +00:00
|
|
|
fi
|