-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathMakefile
112 lines (88 loc) · 3.19 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
USER_GROUP := $(shell id -u):$(shell id -g)
UPSTREAM_OWNER := $(shell scripts/git/upstream_owner.sh)
COMMIT := $(shell scripts/git/commit.sh)
ifeq ($(OS),Windows_NT)
detected_OS := Windows
else
detected_OS := $(shell uname -s)
endif
.PHONY: format
format: json-schema
cd monitoring && make format
.PHONY: lint
lint:
cd monitoring && make lint
cd schemas && make lint
.PHONY: check-hygiene
check-hygiene: python-lint hygiene validate-uss-qualifier-docs shell-lint
.PHONY: python-lint
python-lint:
cd monitoring && make python-lint
.PHONY: hygiene
hygiene:
test/repo_hygiene/repo_hygiene.sh
.PHONY: validate-uss-qualifier-docs
validate-uss-qualifier-docs:
cd monitoring/uss_qualifier && make validate-docs
.PHONY: shell-lint
shell-lint:
echo "===== Checking DSS shell lint except monitoring =====" && find . -name '*.sh' | grep -v '^./interfaces/astm-utm' | grep -v '^./monitoring' | xargs docker run --rm -v "$(CURDIR):/monitoring" -w /monitoring koalaman/shellcheck
cd monitoring && make shell-lint
.PHONY: json-schema
json-schema:
cd schemas && make format
.PHONY: json-schema-lint
json-schema-lint:
cd schemas && make lint
# This mirrors the hygiene-tests continuous integration workflow job (.github/workflows/ci.yml)
.PHONY: hygiene-tests
hygiene-tests: check-hygiene
.PHONY: build-monitoring
build-monitoring:
cd monitoring && make build
tag:
scripts/tag.sh $(UPSTREAM_OWNER)/monitoring/v$(VERSION)
.PHONY: start-locally
start-locally:
build/dev/run_locally.sh up -d
build/dev/wait_for_local_infra.sh
.PHONY: probe-locally
probe-locally:
monitoring/prober/run_locally.sh
.PHONY: start-uss-mocks
start-uss-mocks:
monitoring/mock_uss/start_all_local_mocks.sh
.PHONY: stop-uss-mocks
stop-uss-mocks:
monitoring/mock_uss/stop_all_local_mocks.sh
# The prepended dash ignores errors. This allows collecting logs even if some containers are missing.
.PHONY: collect-local-logs
collect-local-logs:
mkdir -p logs
-sh -c "build/dev/run_locally.sh logs --timestamps" > logs/local_infra.log 2>&1
-docker logs atproxy > logs/atproxy.log 2>&1
-docker logs mock_uss_scdsc_a > logs/mock_uss_scdsc_a.log 2>&1
-docker logs mock_uss_scdsc_b > logs/mock_uss_scdsc_b.log 2>&1
-docker logs mock_uss_ridsp > logs/mock_uss_ridsp.log 2>&1
-docker logs mock_uss_ridsp_v22a > logs/mock_uss_ridsp_v22a.log 2>&1
-docker logs mock_uss_riddp > logs/mock_uss_riddp.log 2>&1
-docker logs mock_uss_riddp_v22a > logs/mock_uss_riddp_v22a.log 2>&1
-docker logs mock_uss_geoawareness > logs/mock_uss_geoawareness.log 2>&1
-docker logs mock_uss_tracer > logs/mock_uss_tracer.log 2>&1
-docker logs mock_uss_tracer_v22a > logs/mock_uss_tracer_v22a.log 2>&1
-docker logs mock_uss_atproxy_client > logs/mock_uss_atproxy_client.log 2>&1
.PHONY: stop-locally
stop-locally:
build/dev/run_locally.sh stop
.PHONY: down-locally
down-locally:
build/dev/run_locally.sh down
.PHONY: check-monitoring
check-monitoring:
cd monitoring && make test
# This mirrors the monitoring-tests continuous integration workflow job (.github/workflows/ci.yml)
.PHONY: monitoring-tests
monitoring-tests: check-monitoring
# This reproduces the entire continuous integration workflow (.github/workflows/ci.yml)
.PHONY: presubmit
presubmit: hygiene-tests monitoring-tests