@@ -5,11 +5,31 @@ IMAGE_NAME := toolhive-cloud-ui
55IMAGE_TAG := latest
66CONTAINER_NAME := toolhive-cloud-ui
77PORT := 3000
8+ RELEASE_NAME := toolhive-cloud-ui
89
910# # Show this help message
1011help :
11- @echo " Available commands:"
12- @grep -E ' ^## ' $(MAKEFILE_LIST ) | sed ' s/## //' | awk ' NR%2==1{printf "\033[36m%-15s\033[0m ",$$1} NR%2==0{print}'
12+ @echo " ToolHive Cloud UI - Available Commands"
13+ @echo " "
14+ @echo " Docker (Local Development):"
15+ @echo " make build - Build production Docker image"
16+ @echo " make start - Start Docker container"
17+ @echo " make stop - Stop Docker container"
18+ @echo " make logs - View container logs"
19+ @echo " make clean - Remove container and image"
20+ @echo " make rebuild - Clean and rebuild"
21+ @echo " "
22+ @echo " Kind (Kubernetes):"
23+ @echo " make kind-setup - Create cluster and deploy (first time)"
24+ @echo " make kind-create - Create Kind cluster"
25+ @echo " make kind-deploy - Build and deploy to Kind"
26+ @echo " make kind-port-forward - Port-forward to localhost:8080"
27+ @echo " make kind-logs - View application logs"
28+ @echo " make kind-uninstall - Uninstall from Kind"
29+ @echo " make kind-delete - Delete Kind cluster"
30+ @echo " "
31+ @echo " Development:"
32+ @echo " make dev - Run Next.js dev server"
1333
1434# # Build the production docker image
1535build :
@@ -51,3 +71,52 @@ shell:
5171rebuild : clean build
5272 @echo " Rebuild complete"
5373
74+ # # Create Kind cluster
75+ kind-create :
76+ @echo " Creating Kind cluster..."
77+ @kind create cluster --name toolhive || echo " Cluster already exists"
78+ @kubectl cluster-info --context kind-toolhive
79+ @echo " Kind cluster ready!"
80+
81+ # # Delete Kind cluster
82+ kind-delete :
83+ @echo " Deleting Kind cluster..."
84+ @kind delete cluster --name toolhive
85+ @echo " Cluster deleted"
86+
87+ # # Build and load image into Kind
88+ kind-build :
89+ @echo " Building Docker image..."
90+ @docker build -t $(IMAGE_NAME ) :$(IMAGE_TAG ) .
91+ @echo " Loading image into Kind cluster..."
92+ @kind load docker-image $(IMAGE_NAME ) :$(IMAGE_TAG ) --name toolhive
93+ @echo " Image loaded successfully"
94+
95+ # # Deploy to Kind with Helm
96+ kind-deploy : kind-build
97+ @echo " Deploying to Kind..."
98+ @helm upgrade --install $(RELEASE_NAME ) ./helm -f ./helm/values-dev.yaml --wait --timeout=5m
99+ @echo " Deployment complete!"
100+ @echo " "
101+ @echo " To access the application, run:"
102+ @echo " make kind-port-forward"
103+ @echo " Then open: http://localhost:8080"
104+
105+ # # Uninstall from Kind
106+ kind-uninstall :
107+ @helm uninstall $(RELEASE_NAME ) || true
108+ @echo " Uninstalled from Kind"
109+
110+ # # View logs
111+ kind-logs :
112+ @kubectl logs -f deployment/$(RELEASE_NAME )
113+
114+ # # Port-forward to localhost
115+ kind-port-forward :
116+ @echo " Forwarding to http://localhost:8080"
117+ @kubectl port-forward svc/$(RELEASE_NAME ) 8080:80
118+
119+ # # Full setup: create cluster and deploy
120+ kind-setup : kind-create kind-deploy
121+ @echo " Setup complete!"
122+
0 commit comments