Skip to content

Commit

Permalink
Cleanup makefile and update docs
Browse files Browse the repository at this point in the history
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: 5e7e8a3
  • Loading branch information
zasgar committed Nov 1, 2019
1 parent e4b80b4 commit dd08f69
Showing 1 changed file with 7 additions and 32 deletions.
39 changes: 7 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,16 @@
## 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.
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
Expand Down Expand Up @@ -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
Expand All @@ -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...]"
Expand All @@ -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." \

0 comments on commit dd08f69

Please sign in to comment.