Ichen Chhoeng ff0e97e36b blah
2025-11-17 11:25:33 +07:00

42 lines
1.4 KiB
Makefile

.PHONY: bootstrap, dev
bootstrap:
@echo "Creating kind cluster 'khmereid' if it doesn't exist..."
@if ! kind get clusters | grep -q '^khmereid$$'; then \
kind create cluster --name khmereid; \
else \
echo "Cluster 'khmereid' already exists, skipping creation"; \
fi
@echo "Applying Kubernetes bootstrap manifests..."
@kubectl apply -k k8s/bootstrap
@kubectl apply -f k8s/bootstrap/bootstrap.yml
@echo "Waiting for namespace 'envoy-gateway-system' to appear..."
@while ! kubectl get namespace envoy-gateway-system >/dev/null 2>&1; do \
printf "."; sleep 2; \
done; \
echo "\nNamespace 'envoy-gateway-system' is ready!"
@echo "Waiting for all pods in all namespaces to be ready (timeout 10 minutes)..."
@kubectl wait --for=condition=Ready pod --all --all-namespaces --timeout=600s
@echo "All pods are ready!"
dev-migrate:
@skaffold run --cleanup=false
@sleep 5
@cd khmereid_backend && dotnet ef database update
@echo "Waiting for all pods in all namespaces to be ready (timeout 10 minutes)..."
@kubectl wait --for=condition=Ready pod --all --all-namespaces --timeout=600s
dev:
@echo "Running Skaffold to build and deploy once..."
@skaffold run --cleanup=false
@echo "Starting local development environment..."
# Port-forward Kratos
@kubectl port-forward svc/kratos-app-public 4433:80 &
# Wait a moment for port-forwards to initialize
@sleep 5
# Run dotnet in watch mode
@cd khmereid_backend && dotnet watch run --urls http://localhost:5200