-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (58 loc) · 2.05 KB
/
Makefile
File metadata and controls
69 lines (58 loc) · 2.05 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
.PHONY: help install-precommit setup-dev lint test clean
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-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
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
check: lint test ## Run all checks (lint + test)
.DEFAULT_GOAL := help