-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
50 lines (40 loc) · 1.07 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
VERSION = 0.0.1
BUILD_COMMIT = $(shell git rev-parse HEAD)
BUILD_TIME = $(shell date +%Y-%m-%dT%H:%M:%S%z)
CURRENT_USER = $(USER)
FLAGS = -X main.version=$(VERSION) -X main.commit=$(BUILD_COMMIT) -X main.buildTime=$(BUILD_TIME) -X main.buildUser=$(CURRENT_USER)
PKGS = ./database/... ./protocol/...
PKGST = ./database ./protocol
.PHONY: install
install:
go install -ldflags "$(FLAGS)" ./cmd/utsdb
.PHONY: clean
clean:
go clean -cache
go clean -testcache
.PHONY: test
test:
go test -v -cover $(PKGS)
.PHONY: fmt
fmt:
goimports -d -l -w $(PKGST) ./playground
.PHONY: generate
generate:
gommon generate -v
.PHONY: loc
loc:
cloc --exclude-dir=vendor,.idea,playground,vagrant,node_modules,libtsdbpb .
##--- docker ---#
.PHONY: docker-stop-all-containers
docker-stop-all-containers:
docker stop $(shell docker ps -a -q)
.PHONY: docker-remove-all-containers
docker-remove-all-containers:
docker rm $(shell docker ps -a -q)
.PHONY: docker-remove-all-volume
docker-remove-all-volume:
docker volume prune
.PHONY: docker-clean-all
docker-clean-all:
docker system prune
##--- docker ---#