-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
57 lines (42 loc) · 1.51 KB
/
Makefile
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
include Makefile.build
include Makefile.testing
export GOPATH ?= $(shell go env GOPATH)
export GO111MODULE ?= on
export GOSUMDB ?= sum.golang.org
export GOFLAGS ?= -mod=mod
export GOPROXY=https://proxy.golang.org,https://goproxy.io,https://gocenter.io,direct
#.DEFAULT_GOAL := all
.PHONY: all
all: mod clean build
.PHONY: mod
mod:
go mod download
.PHONY: clean
clean: ## run all cleanup tasks
go clean ./...
rm -f $(COVERPROFILE)
rm -rf $(BIN_DIR)
##@ Dependencies
golangci: ## install golangci-linter
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${BIN_DIR} v1.27.0
go-acc: ## install coverage tool
go get github.com/ory/[email protected]
install-deps: golangci go-acc ## install necessary dependencies
.PHONY: lint
lint: ## run linter
${BIN_DIR}/golangci-lint --color=always run ./... -v --timeout 5m
##@ Helpers
.PHONY: config
config: ## generate config
mkdir -p $(ARTIFACTS_DIR)
go run ./configuration/gen/gen.go
.PHONY: migrate
migrate: ## migrate
go run ./cmd/migrate/migrate.go --config=.artifacts/migrate.yaml
.PHONY: migrate_loadtest
migrate_loadtest: ## migrations required for load testing API + postgres
go run ./cmd/loadtest_migrate/loadtest_migrate.go --config=./load/migrate_cfg/migrate.yaml
help: ## display help screen
@awk 'BEGIN {FS = ":.*##"; printf "Usage: make \033[36m<target>\033[0m\n"} \
/^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-30s\033[0m %s\n", $$1, $$2 } \
/^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) }' $(MAKEFILE_LIST)