-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
48 lines (40 loc) · 1.52 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
export UNIT_TEST_DIR ?= $(shell pwd)/resources/prometheus/unit_tests/
export PROMETHEUS_RULES_DIR ?= $(shell pwd)/resources/prometheus/downstream/
export CONFIG_DIR ?= $(shell pwd)/config/
export IMAGE ?= quay.io/prometheus/prometheus
export DASHBOARDS_DIR ?= $(shell pwd)/resources/grafana/downstream/
export INDEX_FILE_PATH ?= $(shell pwd)/resources/index.json
export UNIT_TEST_FILES ?= $(shell pwd)/resources/prometheus/unit_tests/
export CRITICAL_SEVERITY="critical"
export WARNING_SEVERITY="warning"
export RHOC_SOPS_REPO_ORG ?= bf2fc6cc711aee1a0c2a
# Checks the prometheus rules in the given rules files
.PHONY: check/rules
check/rules:$(shell pwd)
./scripts/rules-check.sh
# Lint rule files
.PHONY: lint/rules
lint/rules:$(shell pwd)
./scripts/rules-lint.sh
# Check that each dashboard is valid JSON
.PHONY: validate/dashboards
validate/dashboards:$(shell pwd)
./scripts/validate-json.sh
# Check that the index file is valid JSON
.PHONY: validate/index
validate/index:$(shell pwd)
./scripts/validate-index.sh
# Check each alert has a valid unit test
.PHONY: check/unit-tests
check/unit-tests:$(shell pwd)
./scripts/unit-test-check.sh
# Check each alert has a SOP
.PHONY: alerts/sop_url_exists
alerts/sop_url_exists:$(shell pwd)
./scripts/validate-sop-url-exists.sh
.PHONY: validate/sop_url_links
validate/sop_url_links:$(shell pwd)
./scripts/validate-sop-urls.sh
# Run all test targets
.PHONY: run/tests
run/tests: lint/rules alerts/sop_url_exists validate/sop_url_links validate/dashboards validate/index check/rules check/unit-tests