@@ -5,7 +5,7 @@ HELM_REPO_URL=https://devseed.com/eoapi-k8s/
55HELM_CHART_NAME =eoapi/eoapi
66PGO_CHART_VERSION =5.7.4
77
8- .PHONY : all deploy minikube ingest tests integration lint help
8+ .PHONY : all deploy minikube ingest tests integration lint validate-schema help
99
1010# Default target
1111all : deploy
@@ -50,12 +50,38 @@ lint:
5050 fi
5151 @pre-commit run --all-files
5252
53+ validate-schema :
54+ @echo " Validating Helm values schemas..."
55+ @command -v helm > /dev/null 2>&1 || { echo " ❌ helm is required but not installed" ; exit 1; }
56+ @command -v ajv > /dev/null 2>&1 || { echo " ❌ ajv-cli is required but not installed. Run: npm install -g ajv-cli ajv-formats" ; exit 1; }
57+ @for chart_dir in charts/* /; do \
58+ chart_name=$$(basename "$$chart_dir") ; \
59+ if [ -f " $$ {chart_dir}values.schema.json" ]; then \
60+ echo " 🔍 Validating schema for $$ chart_name..." ; \
61+ if helm lint " $$ chart_dir" --strict && \
62+ helm template test " $$ chart_dir" > /dev/null && \
63+ ajv compile -s " $$ {chart_dir}values.schema.json" --spec=draft7 --strict=false && \
64+ python3 -c " import yaml,json; json.dump(yaml.safe_load(open('$$ {chart_dir}values.yaml')), open('/tmp/values-$$ {chart_name}.json','w'))" && \
65+ ajv validate -s " $$ {chart_dir}values.schema.json" -d " /tmp/values-$$ {chart_name}.json" --spec=draft7; then \
66+ rm -f " /tmp/values-$$ {chart_name}.json" ; \
67+ echo " ✅ $$ chart_name validation passed" ; \
68+ else \
69+ rm -f " /tmp/values-$$ {chart_name}.json" ; \
70+ echo " ❌ $$ chart_name validation failed" ; \
71+ exit 1; \
72+ fi ; \
73+ else \
74+ echo " ⚠️ $$ chart_name: no values.schema.json found, skipping" ; \
75+ fi ; \
76+ done
77+
5378help :
5479 @echo " Makefile commands:"
5580 @echo " make deploy - Deploy eoAPI to the configured Kubernetes cluster."
5681 @echo " make minikube - Install eoAPI on minikube."
5782 @echo " make ingest - Ingest STAC collections and items into the database."
5883 @echo " make integration - Run integration tests on connected Kubernetes cluster."
59- @echo " make tests - Run lint + unit tests."
84+ @echo " make tests - Run unit tests."
6085 @echo " make lint - Run linting and code quality checks."
86+ @echo " make validate-schema - Validate Helm values schemas."
6187 @echo " make help - Show this help message."
0 commit comments