-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (31 loc) · 851 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
35
36
37
38
.PHONY: vendor build test short-test run-server run-build lint
vendor:
go mod tidy && go mod vendor
build: vendor
CGO_ENABLED=0 go build -ldflags \
"-w -s" \
-o build/http \
-tags netgo \
-a ./app/cmd/
test:
go test -v ./... -race -cover -coverprofile=coverage.txt
short-test: # excludes tests with external dependencies
go test -v ./... -short -race -cover -coverprofile=coverage.txt
run-server:
POSTGRES_HOST=localhost \
POSTGRES_PORT=5433 \
POSTGRES_USER=postgres \
POSTGRES_PASSWORD=postgres \
POSTGRES_DATABASE=postgres \
REDIS_ADDRESS=localhost:6389 \
PORT=8080 go run app/cmd/main.go
run-build: build
POSTGRES_HOST=localhost \
POSTGRES_PORT=5433 \
POSTGRES_USER=postgres \
POSTGRES_PASSWORD=postgres \
POSTGRES_DATABASE=postgres \
REDIS_ADDRESS=localhost:6389 \
PORT=8080 ./build/http
lint:
golangci-lint run