mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-16 10:34:06 -08:00
3cd2c033e2
Use new `go install` syntax to fetch tools. Signed-off-by: SuperQ <superq@gmail.com>
30 lines
870 B
Makefile
30 lines
870 B
Makefile
JSONNET_FMT := jsonnetfmt -n 2 --max-blank-lines 2 --string-style s --comment-style s
|
|
|
|
all: fmt prometheus_alerts.yaml dashboards_out lint
|
|
|
|
fmt:
|
|
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
|
|
xargs -n 1 -- $(JSONNET_FMT) -i
|
|
|
|
prometheus_alerts.yaml: mixin.libsonnet config.libsonnet alerts.libsonnet
|
|
jsonnet -S alerts.jsonnet > $@
|
|
|
|
dashboards_out: mixin.libsonnet config.libsonnet dashboards.libsonnet
|
|
@mkdir -p dashboards_out
|
|
jsonnet -J vendor -m dashboards_out dashboards.jsonnet
|
|
|
|
lint: prometheus_alerts.yaml
|
|
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
|
|
while read f; do \
|
|
$(JSONNET_FMT) "$$f" | diff -u "$$f" -; \
|
|
done
|
|
|
|
promtool check rules prometheus_alerts.yaml
|
|
|
|
.PHONY: jb_install
|
|
jb_install:
|
|
jb install
|
|
|
|
clean:
|
|
rm -rf dashboards_out prometheus_alerts.yaml
|