-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
37 lines (26 loc) · 918 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
.PHONY: all build lint test
all: build
deps: lint-install
build:
go build -o build/server cmd/server/main.go
vendor:
go mod tidy
lint-install:
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
bash -s -- -b $(shell go env GOPATH)/bin v1.41.1
lint:
@echo "lint"
@golangci-lint --exclude=SA1019 run ./... --deadline=5m
test: postgres
go test -v -failfast -p=1 ./...
generate:
go generate ./lib/database/sql
run: build postgres
./build/server --data-source-name=postgres://telemetry:[email protected]:5432/telemetrydb?sslmode=disable $(EXTRA_ARGS)
postgres:
docker inspect telemetry-postgres > /dev/null ||\
docker run --name telemetry-postgres -e POSTGRES_USER=telemetry -e POSTGRES_PASSWORD=newPassword -e POSTGRES_DB=telemetrydb -p 5432:5432 -d postgres &&\
sleep 3
postgres-clean:
docker stop telemetry-postgres &&\
docker rm telemetry-postgres