This repository was archived by the owner on Feb 23, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
167 lines (137 loc) · 6.28 KB
/
Makefile
File metadata and controls
167 lines (137 loc) · 6.28 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# Makefile for HyperFleet Helm Charts
#
# This repo uses a base + overlay pattern for multi-cloud support.
# See README.md for full documentation.
#
# Prerequisites:
# helm plugin install https://github.com/aslafy-z/helm-git
#
# Usage:
# make help - Show this help
# make deps - Update chart dependencies
# make lint - Lint helm charts
# make template - Render helm templates
# make test-helm - Run all helm chart tests
.PHONY: help deps lint template test test-helm clean \
deps-base deps-gcp \
lint-base lint-gcp \
template-base template-gcp template-gcp-rabbitmq \
install install-pubsub upgrade uninstall status \
test-templates check-helm-git
# Default values
RELEASE_NAME ?= hyperfleet
NAMESPACE ?= hyperfleet-system
CHART_DIR ?= charts/hyperfleet-gcp
# Colors for output
GREEN := \033[0;32m
YELLOW := \033[0;33m
RED := \033[0;31m
NC := \033[0m # No Color
##@ General
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
##@ Dependencies
check-helm-git: ## Check if helm-git plugin is installed
@if ! helm plugin list | grep -q "^helm-git"; then \
echo "$(RED)ERROR: helm-git plugin not installed$(NC)"; \
echo ""; \
echo "Install it with:"; \
echo " helm plugin install https://github.com/aslafy-z/helm-git"; \
echo ""; \
exit 1; \
fi
@echo "$(GREEN)helm-git plugin is installed$(NC)"
deps: deps-base deps-gcp ## Update all chart dependencies
deps-base: check-helm-git ## Update hyperfleet-base dependencies
@echo "$(GREEN)Updating hyperfleet-base dependencies...$(NC)"
cd charts/hyperfleet-base && helm dependency update
@echo "$(GREEN)hyperfleet-base dependencies updated$(NC)"
deps-gcp: deps-base ## Update hyperfleet-gcp dependencies (includes base)
@echo "$(GREEN)Updating hyperfleet-gcp dependencies...$(NC)"
cd charts/hyperfleet-gcp && helm dependency update
@echo "$(GREEN)hyperfleet-gcp dependencies updated$(NC)"
##@ Linting
lint: lint-gcp ## Lint charts (GCP overlay includes base)
lint-gcp: ## Lint hyperfleet-gcp chart (includes base chart validation)
@echo "$(GREEN)Linting hyperfleet-gcp (RabbitMQ values)...$(NC)"
helm lint charts/hyperfleet-gcp -f charts/hyperfleet-gcp/values-rabbitmq.yaml
@echo "$(GREEN)Linting hyperfleet-gcp (Pub/Sub values)...$(NC)"
helm lint charts/hyperfleet-gcp -f examples/gcp-pubsub/values.yaml
##@ Template Rendering
template: template-gcp ## Render templates (default: GCP with Pub/Sub)
template-base: ## Render hyperfleet-base templates
@echo "$(GREEN)Rendering hyperfleet-base templates...$(NC)"
helm template $(RELEASE_NAME) charts/hyperfleet-base --namespace $(NAMESPACE)
template-gcp: ## Render hyperfleet-gcp templates (Pub/Sub)
@echo "$(GREEN)Rendering hyperfleet-gcp templates (Pub/Sub)...$(NC)"
helm template $(RELEASE_NAME) charts/hyperfleet-gcp \
--namespace $(NAMESPACE) \
-f examples/gcp-pubsub/values.yaml
template-gcp-rabbitmq: ## Render hyperfleet-gcp templates (RabbitMQ)
@echo "$(GREEN)Rendering hyperfleet-gcp templates (RabbitMQ)...$(NC)"
helm template $(RELEASE_NAME) charts/hyperfleet-gcp \
--namespace $(NAMESPACE) \
-f charts/hyperfleet-gcp/values-rabbitmq.yaml
##@ Testing
test: test-helm ## Run all tests (alias for test-helm)
test-helm: deps lint test-templates ## Run all helm chart tests
@echo ""
@echo "$(GREEN)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━$(NC)"
@echo "$(GREEN)All tests passed!$(NC)"
@echo "$(GREEN)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━$(NC)"
test-templates: ## Validate all template configurations render without errors
@echo "$(GREEN)Validating template configurations...$(NC)"
@echo ""
@echo "Testing hyperfleet-base (RabbitMQ default)..."
@helm template $(RELEASE_NAME) charts/hyperfleet-base --namespace $(NAMESPACE) > /dev/null
@echo "$(GREEN)hyperfleet-base OK$(NC)"
@echo ""
@echo "Testing hyperfleet-gcp (Pub/Sub)..."
@helm template $(RELEASE_NAME) charts/hyperfleet-gcp \
--namespace $(NAMESPACE) \
-f examples/gcp-pubsub/values.yaml > /dev/null
@echo "$(GREEN)hyperfleet-gcp (Pub/Sub) OK$(NC)"
@echo ""
@echo "Testing hyperfleet-gcp (RabbitMQ)..."
@helm template $(RELEASE_NAME) charts/hyperfleet-gcp \
--namespace $(NAMESPACE) \
-f charts/hyperfleet-gcp/values-rabbitmq.yaml > /dev/null
@echo "$(GREEN)hyperfleet-gcp (RabbitMQ) OK$(NC)"
##@ Deployment
install: deps-gcp ## Install hyperfleet-gcp to cluster (RabbitMQ)
@echo "$(GREEN)Installing hyperfleet-gcp (RabbitMQ)...$(NC)"
helm install $(RELEASE_NAME) charts/hyperfleet-gcp \
--namespace $(NAMESPACE) \
--create-namespace \
-f charts/hyperfleet-gcp/values-rabbitmq.yaml
@echo "$(GREEN)HyperFleet installed$(NC)"
install-pubsub: deps-gcp ## Install hyperfleet-gcp with Pub/Sub (requires customization)
@echo "$(YELLOW)Installing hyperfleet-gcp (Pub/Sub)...$(NC)"
@echo "$(YELLOW)Make sure to customize examples/gcp-pubsub/values.yaml first!$(NC)"
helm install $(RELEASE_NAME) charts/hyperfleet-gcp \
--namespace $(NAMESPACE) \
--create-namespace \
-f examples/gcp-pubsub/values.yaml
@echo "$(GREEN)HyperFleet installed$(NC)"
upgrade: deps-gcp ## Upgrade hyperfleet-gcp
@echo "$(GREEN)Upgrading hyperfleet-gcp...$(NC)"
helm upgrade $(RELEASE_NAME) charts/hyperfleet-gcp \
--namespace $(NAMESPACE) \
-f charts/hyperfleet-gcp/values-rabbitmq.yaml
@echo "$(GREEN)HyperFleet upgraded$(NC)"
uninstall: ## Uninstall hyperfleet
@echo "$(YELLOW)Uninstalling hyperfleet...$(NC)"
helm uninstall $(RELEASE_NAME) --namespace $(NAMESPACE)
@echo "$(GREEN)HyperFleet uninstalled$(NC)"
status: ## Show helm release status
helm status $(RELEASE_NAME) --namespace $(NAMESPACE)
##@ Cleanup
clean: ## Remove generated files (dependency charts, lock files, packages)
@echo "$(GREEN)Cleaning generated files...$(NC)"
rm -rf charts/hyperfleet-base/charts/
rm -rf charts/hyperfleet-gcp/charts/
rm -f charts/hyperfleet-base/Chart.lock
rm -f charts/hyperfleet-gcp/Chart.lock
rm -f *.tgz
rm -f charts/*/*.tgz
@echo "$(GREEN)Clean complete$(NC)"