-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
85 lines (57 loc) · 1.62 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#定义变量
#project:user account auth
#type:api srv web
.PHONY : fmt
fmt :
@echo "格式化代码"
@gofmt -l -w ./
.PHONY : vendor
vendor :
@echo "创建vendor"
@go mod vendor
@echo "结束vendor"
.PHONY : test
test :
@echo "检查代码"
@go vet ./...
@echo "测试代码"
@go test -mod=vendor -race -coverprofile=coverage.txt -covermode=atomic ./...
.PHONY : build
build : proto dockerfile builddata
@echo "部分编译开始:"$(project)_$(type)
@chmod +x ./scripts/build.sh && ./scripts/build.sh build $(type) $(project)
@echo "部分编译结束"
.PHONY : allbuild
allbuild : proto alldockerfile builddata
@echo "全部编译开始"
@chmod +x ./scripts/build.sh && ./scripts/build.sh allbuild
@echo "全部编译结束"
#生成pb文件
.PHONY : proto
proto :
@echo "生成proto开始"
@chmod +x ./scripts/proto.sh && ./scripts/proto.sh
@echo "生成proto结束"
#生成dockerfile
.PHONY : dockerfile
dockerfile :
@echo "部分生成dockerfile开始"
@chmod +x ./scripts/dockerfile.sh && ./scripts/dockerfile.sh df $(project) $(type)
@echo "部分生成Dockerfile结束"
.PHONY : alldockerfile
alldockerfile :
@echo "全部生成dockerfile开始"
@chmod +x ./scripts/dockerfile.sh && ./scripts/dockerfile.sh alldf
@echo "全部生成Dockerfile结束"
#compose命令 bin:up stop restart kill rm ps
.PHONY : compose
compose :
@chmod +x ./scripts/docker-compose.sh && ./scripts/docker-compose.sh $(bin)
.PHONY : builddata
builddata :
@chmod +x ./scripts/builddata.sh && ./scripts/builddata.sh
#编辑k8s配置
.PHONY : k8sconfig
k8sconfig :
@echo "配置k8s"
@chmod +x k8sconf.sh && ./k8sconf.sh