2021-06-07 17:54:22 +00:00
|
|
|
JSONNET_FMT := jsonnetfmt -n 2 --max-blank-lines 1 --string-style s --comment-style s
|
2020-12-03 14:57:42 +00:00
|
|
|
ALERTMANAGER_ALERTS := alertmanager_alerts.yaml
|
|
|
|
|
2021-06-07 17:54:22 +00:00
|
|
|
default: vendor build dashboards_out
|
2020-12-03 14:57:42 +00:00
|
|
|
|
|
|
|
all: fmt build
|
|
|
|
|
2021-06-07 17:54:22 +00:00
|
|
|
vendor:
|
|
|
|
jb install
|
|
|
|
|
2020-12-03 14:57:42 +00:00
|
|
|
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
|
|
|
|
|
2021-06-07 17:54:22 +00:00
|
|
|
|
|
|
|
dashboards_out: mixin.libsonnet config.libsonnet $(wildcard dashboards/*)
|
|
|
|
@mkdir -p dashboards_out
|
|
|
|
jsonnet -J vendor -m dashboards_out dashboards.jsonnet
|
|
|
|
|
|
|
|
build: vendor
|
2020-12-03 14:57:42 +00:00
|
|
|
mixtool generate alerts mixin.libsonnet > $(ALERTMANAGER_ALERTS)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(ALERTMANAGER_ALERTS)
|