29 lines
761 B
Makefile
29 lines
761 B
Makefile
LATEST_RELEASE = "v2.9.1"
|
|
|
|
all: reload
|
|
|
|
.PHONY: all reload install clean
|
|
|
|
reload: install
|
|
systemctl daemon-reload
|
|
systemctl enable --now promtail
|
|
systemctl restart promtail
|
|
|
|
install: promtail promtail.service generate-config
|
|
install -Dm755 promtail /usr/bin/promtail
|
|
install -Dm644 promtail.service /etc/systemd/system/
|
|
|
|
promtail:
|
|
curl -O -L "https://github.com/grafana/loki/releases/download/${LATEST_RELEASE}/promtail-linux-amd64.zip"
|
|
unzip -o "./promtail-linux-amd64.zip"
|
|
mv ./promtail-linux-amd64 ./promtail
|
|
chmod a+x ./promtail
|
|
|
|
generate-config:
|
|
mkdir -p /etc/promtail
|
|
ls /etc/promtail/config-promtail.yml || install -Dm600 config-promtail-template.yml /etc/promtail/config-promtail.yml
|
|
|
|
clean:
|
|
rm -f ./promtail-linux-amd64.zip
|
|
rm -f promtail
|