From dd08f690a291ed186c01a079aa48f8f89e70409b Mon Sep 17 00:00:00 2001 From: Zain Asgar Date: Thu, 31 Oct 2019 23:45:56 -0700 Subject: [PATCH] Cleanup makefile and update docs Summary: Updates the doc strings in the makefile and cleans up unused code. Test Plan: `make help` Reviewers: michelle, oazizi, nserrino, #engineering Reviewed By: oazizi, #engineering Differential Revision: https://phab.corp.pixielabs.ai/D2447 GitOrigin-RevId: 5e7e8a3a42705623f473beb0bd27087e211316a4 --- Makefile | 39 +++++++-------------------------------- 1 file changed, 7 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index 860ec3f1aa4..c259c2570a2 100644 --- a/Makefile +++ b/Makefile @@ -5,16 +5,9 @@ ## Bazel command to use. BAZEL := bazel -## Dep command to use. -DEP := dep - ## Minikube command to use. MINIKUBE := minikube -## Kubectl command to use. -KUBECTL := kubectl -KUBECTL_FLAGS := -n pl - WORKSPACE := $$(bazel info workspace) ## Skaffold command to use. @@ -22,15 +15,6 @@ SKAFFOLD := skaffold SKAFFOLD_DIR := $(WORKSPACE)/skaffold -## Active operating system (Linux vs MacOS). -UNAME_S := $(shell uname -s) - -# Minikube flags to select vm-driver under MacOS -ifeq ($(UNAME_S),Darwin) - MINIKUBE_START_FLAGS += --vm-driver hyperkit -endif - - .PHONY: clean clean: $(BAZEL) clean @@ -63,13 +47,16 @@ test-tsan: ## Run all the tests (except UI), with thread sanitizer. go-mod-ensure: ## Ensure that go dependencies exist. go mod download +.PHONY: gazelle-repos gazelle-repos: go.mod $(BAZEL) run //:gazelle -- update-repos -from_file=go.mod -gazelle: gazelle-repos ## Run gazelle to update go build rules. +.PHONY: gazelle +gazelle: gazelle-repos $(BAZEL) run //:gazelle -go-setup: go-mod-ensure gazelle +.PHONY: go-setup +go-setup: go-mod-ensure gazelle ## Run go setup to regenrate modules/build files. dev-env-start: ## Start K8s dev environment. $(WORKSPACE)/scripts/setup_dev_k8s.sh @@ -80,19 +67,6 @@ dev-env-stop: ## Stop dev environment. dev-env-teardown: dev-env-stop ## Clean up dev environment. $(MINIKUBE) delete -deploy-vizier-nightly: ## Deploy vizier in nightly environment. - PL_BUILD_TYPE=nightly $(SKAFFOLD) run -f $(SKAFFOLD_DIR)/skaffold_vizier.yaml - -deploy-customer-docs-nightly: ## Deploy customer docs in nightly environment. - PL_BUILD_TYPE=nightly $(SKAFFOLD) run -f $(SKAFFOLD_DIR)/skaffold_customer_docs.yaml - -gen-jwt: ## Generate a JWT for our demo cluster. - @JWT=$$(PL_JWT_SIGNING_KEY=ABCDEFG $(BAZEL) run //src/utils/gen_test_key); \ - echo ""; \ - echo "Paste the following into your browser console:"; \ - echo "pltoken='$$JWT';"; \ - echo "localStorage.setItem('auth', JSON.stringify({'idToken':pltoken}));" - help: ## Print help for targets with comments. @echo "Usage:" @echo " make [target...] [VAR=foo VAR2=bar...]" @@ -109,5 +83,6 @@ help: ## Print help for targets with comments. @echo "" @echo "Typical usage:" @printf " $(cyan)%s$(term-reset)\n %s\n\n" \ - "make build" "Run a clean build and update all the GO deps." \ + "make build" "Run a clean build." \ + "make go-setup" "Update go deps by re-generating go modules and build files." \ "make pristine" "Delete all cached builds." \