-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathMakefile
54 lines (40 loc) · 1018 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
build: fmt check compile
fmt:
goimports -w main.go
goimports -w server/conf/*.go
goimports -w server/core/*.go
goimports -w server/store/*.go
go mod tidy
check:
go vet ./...
staticcheck ./...
update:
go get -u honnef.co/go/tools/cmd/staticcheck
compile:
go build ./...
releaser:
goreleaser --snapshot --rm-dist --skip-validate --skip-publish --parallelism 12
install: build
go install ./...
cover: test
go tool cover -html=./coverage.out
test: fmt check
rm -rf ./cover.out
go test -tags test -race -coverpkg=./server/... -coverprofile=./coverage.out ./...
fasttest:
scripts/cov.sh
failfast:
go test -tags test -race -failfast ./...
.PHONY: dockerx
dockerx:
ifneq ($(ver),)
# Ensure 'docker buildx ls' shows correct platforms.
docker buildx build \
--tag natsio/nats-account-server:$(ver) --tag natsio/nats-account-server:latest \
--platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 \
--push .
else
# Missing version, try this.
# make dockerx ver=1.2.3
exit 1
endif