-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (42 loc) · 2.36 KB
/
Copy pathMakefile
File metadata and controls
53 lines (42 loc) · 2.36 KB
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
CHART := charts/lgtm
.PHONY: values check-values deps lint validate-dashboards template kubeconform docs-validate all
## Assemble charts/lgtm/values.yaml from values.d/ fragments
values:
python3 scripts/assemble_values.py
## Fail if values.yaml is out of sync with values.d/ (used in CI)
check-values:
python3 scripts/assemble_values.py --check
## Fetch chart dependencies pinned in Chart.lock
deps:
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts --force-update
helm repo add grafana-community https://grafana-community.github.io/helm-charts --force-update
helm repo add grafana https://grafana.github.io/helm-charts --force-update
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts --force-update
helm dependency build $(CHART)
lint: check-values validate-dashboards
helm lint $(CHART)
## Validate Grafana dashboard JSON (well-formed + datasource refs resolve)
validate-dashboards:
python3 scripts/validate_dashboards.py
## Render the chart in the default, collectors-off, and every example configuration
template: check-values
helm template lgtm $(CHART) --namespace observability > /dev/null
helm template lgtm $(CHART) --namespace observability --set collectors.enabled=false > /dev/null
for f in $(CHART)/examples/values-*.yaml; do \
helm template lgtm $(CHART) --namespace observability -f $$f > /dev/null || exit 1; \
done
@echo "all template permutations rendered"
## Validate rendered manifests against Kubernetes + CRD schemas
kubeconform: check-values
helm template lgtm $(CHART) --namespace observability | kubeconform \
-strict -ignore-missing-schemas \
-schema-location default \
-schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json'
# The validator needs a checkout of the framework repo for the taxonomy files
# (the uvx wheel only ships the tooling). Clone once into .cache/.
DOCS_FW_VERSION := 0.7.0
DOCS_FW_ROOT := .cache/docs-framework
docs-validate:
@test -d $(DOCS_FW_ROOT) || git clone --depth 1 --branch v$(DOCS_FW_VERSION) https://github.com/promptlylabs/docs-framework $(DOCS_FW_ROOT)
DOCS_FRAMEWORK_ROOT=$(DOCS_FW_ROOT) uvx --from 'git+https://github.com/promptlylabs/docs-framework@v$(DOCS_FW_VERSION)#subdirectory=tooling' docs-framework validate docs/
all: values deps lint template kubeconform