|
| 1 | +# bingo manages consistent tooling versions for things like kind, kustomize, etc. |
| 2 | +include .bingo/Variables.mk |
| 3 | + |
| 4 | +CONTAINER_ENGINE ?= docker |
| 5 | + |
| 6 | +.DEFAULT_GOAL := build |
| 7 | + |
| 8 | +##@ General |
| 9 | + |
| 10 | +# The help target prints out all targets with their descriptions organized |
| 11 | +# beneath their categories. The categories are represented by '##@' and the |
| 12 | +# target descriptions by '##'. The awk commands is responsible for reading the |
| 13 | +# entire set of makefiles included in this invocation, looking for lines of the |
| 14 | +# file as xyz: ## something, and then pretty-format the target and help. Then, |
| 15 | +# if there's a line with ##@ something, that gets pretty-printed as a category. |
| 16 | +# More info on the usage of ANSI control characters for terminal formatting: |
| 17 | +# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters |
| 18 | +# More info on the awk command: |
| 19 | +# http://linuxcommand.org/lc3_adv_awk.php |
| 20 | + |
| 21 | +.PHONY: help |
| 22 | +help: ## Display this help. |
| 23 | + @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) |
| 24 | + |
| 25 | +##@ Development |
| 26 | + |
| 27 | +node_modules: package.json package-lock.json |
| 28 | + npm ci |
| 29 | + |
| 30 | +.PHONY: build |
| 31 | +build: $(HUGO) node_modules ## Build the site. |
| 32 | + HUGO_ENV=production $(HUGO) |
| 33 | + |
| 34 | +.PHONY: serve |
| 35 | +serve: $(HUGO) ## Build and serves the site locally. |
| 36 | + $(HUGO) serve |
| 37 | + |
| 38 | +.PHONY: lint |
| 39 | +lint: build ## Run docs linting. |
| 40 | + CONTAINER_ENGINE="$(CONTAINER_ENGINE)" \ |
| 41 | + CONTAINER_RUN_EXTRA_OPTIONS="$(CONTAINER_RUN_EXTRA_OPTIONS)" \ |
| 42 | + ./hack/ci/link-check.sh |
0 commit comments