-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (24 loc) · 904 Bytes
/
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
BIN_APP := "./bin/limiter"
BIN_MIGRATE := "./bin/limiter-migrator"
generate:
protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
api/RateLimiter.proto
build:
go build -o $(BIN_APP) ./cmd/api-rate-limiter
build-migrations:
go build -o $(BIN_MIGRATE) ./cmd/migrations
run:
docker-compose up
test:
CGO_ENABLED=1 go test --race -count 10 ./...
migrate-status: build-migrations
$(BIN_MIGRATE) -config="./configs/config.yml" status
migrate-up: build-migrations
$(BIN_MIGRATE) -config="./configs/config.yml" up
migrate-down: build-migrations
$(BIN_MIGRATE) -config="./configs/config.yml" down
install-lint-deps:
(which golangci-lint > /dev/null) || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.54.2
lint: install-lint-deps
golangci-lint run ./...