dataset/seed/loki/manual/image/postinstall/loki.sh

18 lines
595 B
Bash
Raw Normal View History

2023-06-23 08:12:05 +02:00
set -ex
#FIXME unsign?
mkdir -p ~/loki/
URL=$(wget https://api.github.com/repos/grafana/loki/releases/latest -q -O - | jq -r '.assets[].browser_download_url'|grep loki-linux-amd64)
VERS=$(echo "$URL" | awk -F'/' '{ print $8 }')
if [ ! -f ~/"loki/loki-$VERS-linux-amd64.zip" ]; then
rm -rf ~/"loki/loki-*-linux-amd64.zip"
wget "$URL" -O ~/"loki/loki-$VERS-linux-amd64.zip"
fi
cp -a ~/"loki/loki-$VERS-linux-amd64.zip" .
unzip "loki-$VERS-linux-amd64.zip"
mv "loki-linux-amd64" "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/bin/loki"
chmod +x "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/bin/loki"