Skip to content

Commit cdf3452

Browse files
committed
refactor(makefile): use RELEASE_NAME variable for helm commands
- Add RELEASE_NAME variable to avoid hardcoded deployment name - Use variable in kind-deploy, kind-uninstall, kind-logs, kind-port-forward - Improves flexibility and maintainability - Addresses Copilot review suggestion
1 parent 2280e7f commit cdf3452

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ IMAGE_NAME := toolhive-cloud-ui
55
IMAGE_TAG := latest
66
CONTAINER_NAME := toolhive-cloud-ui
77
PORT := 3000
8+
RELEASE_NAME := toolhive-cloud-ui
89

910
## Show this help message
1011
help:
@@ -94,7 +95,7 @@ kind-build:
9495
## Deploy to Kind with Helm
9596
kind-deploy: kind-build
9697
@echo "Deploying to Kind..."
97-
@helm upgrade --install toolhive-cloud-ui ./helm -f ./helm/values-dev.yaml --wait --timeout=5m
98+
@helm upgrade --install $(RELEASE_NAME) ./helm -f ./helm/values-dev.yaml --wait --timeout=5m
9899
@echo "Deployment complete!"
99100
@echo ""
100101
@echo "To access the application, run:"
@@ -103,17 +104,17 @@ kind-deploy: kind-build
103104

104105
## Uninstall from Kind
105106
kind-uninstall:
106-
@helm uninstall toolhive-cloud-ui || true
107+
@helm uninstall $(RELEASE_NAME) || true
107108
@echo "Uninstalled from Kind"
108109

109110
## View logs
110111
kind-logs:
111-
@kubectl logs -f deployment/toolhive-cloud-ui
112+
@kubectl logs -f deployment/$(RELEASE_NAME)
112113

113114
## Port-forward to localhost
114115
kind-port-forward:
115116
@echo "Forwarding to http://localhost:8080"
116-
@kubectl port-forward svc/toolhive-cloud-ui 8080:80
117+
@kubectl port-forward svc/$(RELEASE_NAME) 8080:80
117118

118119
## Full setup: create cluster and deploy
119120
kind-setup: kind-create kind-deploy

0 commit comments

Comments
 (0)