-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (28 loc) · 1.49 KB
/
Makefile
File metadata and controls
36 lines (28 loc) · 1.49 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
# Makefile for maintaining the GitOps AI Skills assets.
# Run 'make help' to see available targets.
SCHEMAS_DIRS := skills/gitops-repo-audit/assets/schemas \
skills/gitops-cluster-debug/assets/schemas \
skills/gitops-knowledge/assets/schemas
DISCOVER_SCRIPT := skills/gitops-repo-audit/scripts/discover.sh
VALIDATE_SCRIPT := skills/gitops-repo-audit/scripts/validate.sh
TEST_DIR := tests/gitops-repo-audit
.PHONY: help download-schemas clean-schemas test-discover test-validate
download-schemas: clean-schemas ## Download Flux OpenAPI schemas for kubeconform validation
@for dir in $(SCHEMAS_DIRS); do \
mkdir -p $$dir; \
curl -sL https://github.com/controlplaneio-fluxcd/flux-operator/releases/latest/download/crd-schemas.tar.gz | tar zxf - -C $$dir; \
curl -sL https://github.com/fluxcd/flux2/releases/latest/download/crd-schemas.tar.gz | tar zxf - -C $$dir; \
rm -f $$dir/all.json $$dir/_definitions.json; \
done
clean-schemas: ## Remove downloaded schemas
@for dir in $(SCHEMAS_DIRS); do \
rm -rf $$dir; \
done
test-discover: ## Run discovery script on the test fixtures
$(DISCOVER_SCRIPT) -d $(TEST_DIR)/multi-repo-structure
$(DISCOVER_SCRIPT) -d $(TEST_DIR)/monorepo-structure
test-validate: ## Run validation script on the test fixtures
$(VALIDATE_SCRIPT) -d $(TEST_DIR)/multi-repo-structure
$(VALIDATE_SCRIPT) -d $(TEST_DIR)/monorepo-structure
help: ## Show this help message
@grep -E '^[a-zA-Z_-]+:.*##' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*## "}; {printf " %-20s %s\n", $$1, $$2}'