-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (23 loc) · 919 Bytes
/
Makefile
File metadata and controls
32 lines (23 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
.PHONY: all build deps generate help test version
CHECK_FILES ?= $$(go list ./... | grep -v /vendor/)
help: ## Show this help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
all: deps generate build test ## Run all steps
build: ## Build all
go build ./...
dev: ## Run the development server
go run ./cmd/server/main.go
deps: ## Download dependencies.
go mod tidy
generate: ## Run code generation
go generate ./...
test: ## Run tests
go test -v $(CHECK_FILES)
version: ## Run the goversion tool. Usage: make version bump="patch" [files="-file=README.md"]
@# Check that the 'bump' variable is provided.
@if [ -z "$(bump)" ]; then \
echo "Error: You must provide a bump argument, e.g. bump=\"patch\"" >&2; \
exit 1; \
fi
@echo "Running goversion with bump: $(bump)"
go run main.go $(bump)