-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (34 loc) · 1.11 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
BINPATH ?= build
BUILD_TIME=$(shell date +%s)
GIT_COMMIT=$(shell git rev-parse HEAD)
VERSION ?= $(shell git tag --points-at HEAD | grep ^v | head -n 1)
LDFLAGS = -ldflags "-X main.BuildTime=$(BUILD_TIME) -X main.GitCommit=$(GIT_COMMIT) -X main.Version=$(VERSION)"
.PHONY: all
all: audit test build
.PHONY: audit
audit:
go list -m all | nancy sleuth
.PHONY: build
build:
go build -tags 'production' $(LDFLAGS) -o $(BINPATH)/dp-cantabular-filter-flex-api
.PHONY: debug
debug:
go build -tags 'debug' $(LDFLAGS) -o $(BINPATH)/dp-cantabular-filter-flex-api
HUMAN_LOG=1 DEBUG=1 $(BINPATH)/dp-cantabular-filter-flex-api
.PHONY: debug-run
debug-run:
HUMAN_LOG=1 DEBUG=1 go run -race -tags 'debug' $(LDFLAGS) main.go
.PHONY: test
test:
go test -race -cover ./...
.PHONY: convey
convey:
goconvey ./...
.PHONY: test-component
test-component:
cd features/compose; docker-compose up --abort-on-container-exit
echo "please ignore error codes 0, like so: ERRO[xxxx] 0, as error code 0 means that there was no error"
.PHONY: lint
lint:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.2
golangci-lint run ./...