forked from coroot/coroot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (43 loc) · 880 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
55
56
57
58
UI_PATH = front
.PHONY: all
all: lint test
.PHONY: lint
lint: go-lint ui-lint
.PHONY: test
test: go-test
.PHONY: go-lint
go-lint: go-mod go-vet go-fmt go-imports
.PHONY: go-mod
go-mod:
go mod tidy
.PHONY: go-vet
go-vet:
go vet ./...
.PHONY: go-fmt
go-fmt:
gofmt -w .
.PHONY: go-imports
go-imports:
go install golang.org/x/tools/cmd/goimports@latest
goimports -w .
.PHONY: go-test
go-test:
go test ./...
.PHONY: ui-lint
ui-lint: npm-install npm-lint npm-fmt
.PHONY: npm-install
npm-install:
cd $(UI_PATH) && npm ci
.PHONY: npm-lint
npm-lint:
cd $(UI_PATH) && npm run lint
.PHONY: npm-fmt
npm-fmt:
cd $(UI_PATH) && npm run fmt
.PHONY: npm-build
npm-build:
cd $(UI_PATH) && npm run build-prod
.PHONY: docker
#docker: npm-build # 暂时不改前端,所以不需要重新构建
docker:
docker build . -t registry.cn-beijing.aliyuncs.com/obser/coroot:latest