-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (37 loc) · 1.38 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
VERSION=`git describe --tags`
BUILD=`date +%FT%T%z`
GITHASH=`git rev-parse HEAD`
GIT_BRANCH=`git branch --show-current`
GO=go
GOCOVER=$(GO) tool cover
GOTEST=$(GO) test
.PHONY: fmt dev lint vet test test-cover build-all-in-one build-cobra build-ksqlgrammar all
all:
make fmt vet lint test
dev:
go install github.com/golangci/golangci-lint/cmd/[email protected]
build:
touch internal/version.go
go build -ldflags "all=-X github.com/thmeitz/ksqldb-migrate/internal.version=${VERSION} -X github.com/thmeitz/ksqldb-migrate/internal.build=${BUILD} -X github.com/thmeitz/ksqldb-migrate/internal.hash=${GITHASH}" -a -o ksqldb-migrate .
release:
./build-release.sh github.com/thmeitz/ksqldb-migrate
test:
$(GOTEST) -v ./... -short
gosec -no-fail -fmt=sonarqube -out coverage/secreport.json ./...
test-cover:
$(GOTEST) ./... -coverprofile=coverage/coverage.out
$(GOCOVER) -func=coverage/coverage.out
$(GOCOVER) -html=coverage/coverage.out
golangci-lint run ./... --verbose --no-config --out-format checkstyle > coverage/golangci-lint.out
vet: ## run go vet on the source files
$(GO) vet ./...
doc: ## generate godocs and start a local documentation webserver on port 8085
GO111MODULE=off godoc -notes=TODO -goroot=. -http=:8085 -index
lint:
golangci-lint run
clean-compose:
docker-compose down && docker-compose up -d
fmt:
$(GO) fmt ./...
changelog:
git-chglog --output CHANGELOG.md