2019-04-03 12:01:02 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -x
|
|
|
|
set -e
|
|
|
|
|
|
|
|
TOOLS_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
|
|
|
|
|
2020-07-21 19:56:41 -07:00
|
|
|
pushd "$TOOLS_DIR"
|
2019-04-03 12:01:02 +08:00
|
|
|
|
|
|
|
# Download Prometheus server.
|
|
|
|
unamestr="$(uname)"
|
|
|
|
if [[ "$unamestr" == "Linux" ]]; then
|
|
|
|
echo "Downloading Prometheus server for linux system."
|
|
|
|
PACKAGE_NAME=prometheus-2.8.0.linux-amd64
|
|
|
|
elif [[ "$unamestr" == "Darwin" ]]; then
|
|
|
|
echo "Downloading Prometheus server for MacOS system."
|
|
|
|
PACKAGE_NAME=prometheus-2.8.0.darwin-amd64
|
|
|
|
else
|
|
|
|
echo "Downloading abort: Unrecognized platform."
|
2020-07-24 15:24:19 -07:00
|
|
|
exit 1
|
2019-04-03 12:01:02 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
URL=https://github.com/prometheus/prometheus/releases/download/v2.8.0/$PACKAGE_NAME.tar.gz
|
|
|
|
wget $URL
|
|
|
|
tar xvfz $PACKAGE_NAME.tar.gz
|
|
|
|
|
|
|
|
popd
|