Skip to content

Commit

Permalink
check gum and helm is installed properly (#2326)
Browse files Browse the repository at this point in the history
  • Loading branch information
savingoyal authored Mar 3, 2025
1 parent 99fdad2 commit 232de81
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions devtools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ DEVTOOLS_DIR := $(MKFILE_DIR).devtools
PICK_SERVICES := $(MKFILE_DIR)pick_services.sh
MINIKUBE_DIR := $(DEVTOOLS_DIR)/minikube
MINIKUBE := $(MINIKUBE_DIR)/minikube
HELM_DIR := $(DEVTOOLS_DIR)/helm
TILT_DIR := $(DEVTOOLS_DIR)/tilt
TILT := $(TILT_DIR)/tilt
TILTFILE := $(MKFILE_DIR)/Tiltfile
Expand Down Expand Up @@ -51,9 +52,18 @@ endif

install-helm:
@if ! command -v helm >/dev/null 2>&1; then \
echo "πŸ“₯ Installing Helm $(HELM_VERSION) (may require sudo access)..."; \
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | HELM_INSTALL_VERSION=$(HELM_VERSION) bash; \
echo "πŸ“₯ Installing Helm $(HELM_VERSION)..."; \
mkdir -p "$(HELM_DIR)"; \
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 \
| HELM_INSTALL_VERSION="$(HELM_VERSION)" \
USE_SUDO="false" \
PATH="$(HELM_DIR):$$PATH" \
HELM_INSTALL_DIR="$(HELM_DIR)" \
bash; \
chmod +x "$(HELM_DIR)/helm"; \
echo "βœ… Helm installation complete"; \
else \
echo "βœ… Helm is already installed at $$(command -v helm)"; \
fi

check-docker:
Expand Down Expand Up @@ -99,7 +109,7 @@ install-gum:
@if ! command -v gum >/dev/null 2>&1; then \
echo "πŸ“₯ Installing gum..."; \
if [ "$(shell uname)" = "Darwin" ]; then \
HOMEBREW_NO_AUTO_UPDATE=1 brew install gum; \
HOMEBREW_NO_AUTO_UPDATE=1 brew install gum|| { echo "❌ Failed to install gum via Homebrew"; exit 1; }; \
elif command -v apt-get >/dev/null 2>&1; then \
curl -fsSL -o /tmp/gum.deb \
"https://github.com/charmbracelet/gum/releases/download/$(GUM_VERSION)/gum_$(GUM_VERSION:v%=%)_$(arch).deb"; \
Expand Down Expand Up @@ -182,7 +192,7 @@ up: install-brew check-docker install-curl install-gum setup-minikube install-he
@echo 'PATH="$(MINIKUBE_DIR):$(TILT_DIR):$$PATH" $(MINIKUBE) tunnel &' >> $(DEVTOOLS_DIR)/start.sh
@echo 'echo -e "πŸš€ Starting Tilt with selected services..."' >> $(DEVTOOLS_DIR)/start.sh
@echo 'echo -e "\033[1;38;5;46m\nπŸ”₯ \033[1;38;5;196mNext Steps:\033[0;38;5;46m Use \033[3mmetaflow-dev shell\033[23m to switch to the development\n environment'\''s shell and start executing your Metaflow flows.\n\033[0m"' >> "$(DEVTOOLS_DIR)/start.sh"
@echo 'PATH="$(MINIKUBE_DIR):$(TILT_DIR):$$PATH" SERVICES="$$SERVICES" tilt up -f $(TILTFILE)' >> $(DEVTOOLS_DIR)/start.sh
@echo 'PATH="$(HELM_DIR):$(MINIKUBE_DIR):$(TILT_DIR):$$PATH" SERVICES="$$SERVICES" tilt up -f $(TILTFILE)' >> $(DEVTOOLS_DIR)/start.sh
@echo 'wait' >> $(DEVTOOLS_DIR)/start.sh
@chmod +x $(DEVTOOLS_DIR)/start.sh
@$(DEVTOOLS_DIR)/start.sh
Expand Down

0 comments on commit 232de81

Please sign in to comment.