18 lines
595 B
Bash
18 lines
595 B
Bash
|
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"
|