mirror of
https://github.com/prometheus/alertmanager
synced 2025-02-18 03:27:04 +00:00
Add an Alertmanager mixin Signed-off-by: beorn7 <beorn@grafana.com> Co-authored-by: Tom Wilkie <tom.wilkie@gmail.com> Co-authored-by: beorn7 <beorn@grafana.com> Co-authored-by: Simon Pasquier <spasquie@redhat.com>
25 lines
620 B
Makefile
25 lines
620 B
Makefile
JSONNET_FMT := jsonnetfmt -n 2 --max-blank-lines 2 --string-style s --comment-style s
|
|
ALERTMANAGER_ALERTS := alertmanager_alerts.yaml
|
|
|
|
default: build
|
|
|
|
all: fmt build
|
|
|
|
fmt:
|
|
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
|
|
xargs -n 1 -- $(JSONNET_FMT) -i
|
|
|
|
lint: build
|
|
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
|
|
while read f; do \
|
|
$(JSONNET_FMT) "$$f" | diff -u "$$f" -; \
|
|
done
|
|
|
|
mixtool lint mixin.libsonnet
|
|
|
|
build:
|
|
mixtool generate alerts mixin.libsonnet > $(ALERTMANAGER_ALERTS)
|
|
|
|
clean:
|
|
rm -rf $(ALERTMANAGER_ALERTS)
|