-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
87 lines (70 loc) · 2.79 KB
/
Makefile
File metadata and controls
87 lines (70 loc) · 2.79 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
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
.PHONY: help install-precommit setup-dev lint lint-actions lint-devspace test test-install test-e2e smoke clean verify
help: ## Display this help message
@echo "Available targets:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-20s %s\n", $$1, $$2}'
install-precommit: ## Install pre-commit hooks
@echo "Installing pre-commit..."
@if ! command -v pre-commit &> /dev/null; then \
echo "pre-commit not found. Installing via pip..."; \
pip install pre-commit; \
fi
pre-commit install
setup-dev: install-precommit ## Set up development environment
@echo "Setting up development environment..."
@if ! command -v helm &> /dev/null; then \
echo "⚠️ Helm not found. Please install Helm first."; \
echo " brew install helm"; \
exit 1; \
fi
@if ! command -v yamllint &> /dev/null; then \
echo "Installing yamllint..."; \
pip install yamllint; \
fi
@if ! helm plugin list | grep -q unittest; then \
echo "Installing helm-unittest plugin..."; \
helm plugin install https://github.com/helm-unittest/helm-unittest; \
fi
@echo "✅ Development environment ready!"
lint: ## Run all linting checks
@echo "Running pre-commit on all files..."
pre-commit run --all-files
lint-actions: ## Lint GitHub Actions workflows
@echo "Running actionlint..."
go run github.com/rhysd/actionlint/cmd/actionlint@latest
lint-devspace: ## Validate DevSpace config syntax and substitution
@echo "Validating DevSpace config..."
devspace print --skip-info --disable-profile-activation >/tmp/devspace-starter-pack-devspace.yaml
lint-yaml: ## Run YAML linting only
@echo "Running yamllint..."
yamllint .
lint-helm: ## Run Helm linting only
@echo "Running helm lint on all charts..."
@find charts -name "Chart.yaml" -exec dirname {} \; | while read chart; do \
echo "Linting $$chart..."; \
helm lint "$$chart" --strict; \
done
test: ## Run all tests
@echo "Running helm unittest..."
@find charts -name "Chart.yaml" -exec dirname {} \; | while read chart; do \
if [ -d "$$chart/tests" ]; then \
echo "Testing $$chart..."; \
cd "$$chart" && helm unittest . && cd - > /dev/null; \
fi \
done
test-install: ## Run live DevSpace install diagnostics
CGO_ENABLED=1 go test -count=1 -v -timeout 5m ./tests/install
test-e2e: ## Run full ephemeral-cluster DevSpace e2e validation
go run ./tests/e2e/cmd/smoke
smoke: test-e2e ## Run expensive smoke validation
clean: ## Clean up generated files
@echo "Cleaning up..."
rm -rf charts/*/charts/
rm -f charts/*/Chart.lock
rm -f charts/*.tgz
pre-commit clean
format: ## Auto-format files where possible
@echo "Auto-formatting files..."
pre-commit run --all-files || true
verify: lint lint-actions lint-devspace test ## Run CI-equivalent local validation without a cluster
check: verify ## Run all checks
.DEFAULT_GOAL := help