-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
156 lines (100 loc) · 3.45 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
.PHONY: all
## all: build all docker containers
all: help
## build: build all basic docker containers
build: alpine ubuntu redis
# hold it
@echo " > build for '$(DOCKER_USERNAME)'..."
## lint: verify the source codes (never used)
lint:
@echo " > lint '$(GITHUB_TOKEN)'..."
## test: test the syntax (never used)
test:
@echo " > test ..."
## publish: publish docker containers (never used)
publish:
@echo " > publish ..."
## alpine: build 'alpine' docker container
alpine: | ./alpine-base/ ./alpine-base-net/
@echo done
.PHONY: ./alpine-base/ ./alpine-base-net/ alpine
./alpine-base/:
@echo " > build alpine for '$(DOCKER_USERNAME)'..."
$(MAKE) -C $@ # $(MAKECMDGOALS)
./alpine-base-net/:
$(MAKE) -C $@ # $(MAKECMDGOALS)
## ubuntu: build 'ubuntu-mod' docker container
ubuntu: | ./ubuntu-mod/
@echo done
.PHONY: ./ubuntu-mod/ ubuntu
./ubuntu-mod/: | ./ubuntu-mod/*
$(MAKE) -C $@
## redis: build 'redis' docker container
redis: | ./redis-mod/
@echo done
.PHONY: ./redis-mod/ redis
./redis-mod/: | ./redis-mod/*
$(MAKE) -C $@
## run-monitor: run 'monitor' containers. :(could be: make run-monitor cmd=start,stop,logs,run,clear)
run-monitor:
(cd ./monitor; $(MAKE) $(or $(cmd),start))
# cmd=$(or $(cmd),start))
@echo open grafana at: http://localhost:13000
.PHONY: ./monitor/ run-monitor
./monitor/:
@echo ' @: $@'
@echo ' cmd: $(or $(cmd),start)'
$(MAKE) -C $@ $(or $(cmd),start)
## run-nacos: run 'nacos' containers. :(could be: make run-nacos cmd=start,stop,logs,run,clear)
run-nacos: | ./nacos-std/
@echo open nacos web ui at: http://localhost:8848/nacos
.PHONY: ./nacos-std/ run-nacos
./nacos-std/:
$(MAKE) -C $@ $(or $(cmd),start)
## run-zipkin: run 'zipkin' containers. :(could be: make run-zipkin cmd=start,stop,logs,run,clear)
run-zipkin: | ./zipkin-std/
@echo open zipkin web ui at: http://localhost:9411/
.PHONY: ./zipkin-std/ run-zipkin
./zipkin-std/:
$(MAKE) -C $@ $(or $(cmd),start)
## run-zipkin: run 'etcd'+'db'+'cache' containers. :(could be: make run-etcd cmd=start,stop,logs,run,clear)
run-etcd: | ./etcd-std/
@echo open etcd web ui at: http://localhost:32000/
@echo connect with etcd 3: localhost:32379
@echo connect with mysql 8: localhost:33306
@echo connect with redis 5: localhost:36379
.PHONY: ./etcd-std/ run-etcd
./etcd-std/:
$(MAKE) -C $@ $(or $(cmd),start)
## run-es: run 'elasticsearch' containers. :(could be: make run-es cmd=start,stop,logs,run,clear)
run-es: | ./elasticsearch-std/
@echo connect elasticsearch: localhost:9200
@echo connect elasticsearch web ui (cerebro): localhost:9000
.PHONY: ./elasticsearch-std/ run-elasticsearch
./elasticsearchin-std/:
$(MAKE) -C $@ $(or $(cmd),start)
## run-skyw: run 'skywalking' containers. :(could be: make run-skyw cmd=start,stop,logs,run,clear)
run-skyw: | ./skywalking-std/
@echo open zipkin web ui at: http://localhost:9411/
.PHONY: ./skywalking-std/ run-skywalking
./skywalking-std/:
$(MAKE) -C $@ $(or $(cmd),start)
.PHONY: printvars info help all
## printvars: print all envvars
printvars:
$(foreach V, $(sort $(filter-out .VARIABLES,$(.VARIABLES))), $(info $(v) = $($(v))) )
# Simple:
# (foreach v, $(filter-out .VARIABLES,$(.VARIABLES)), $(info $(v) = $($(v))) )
print-%:
@echo $* = $($*)
## info: dump alternate envvars
info:
@echo " DOCKER_OPTS: $(DOCKER_OPTS)"
@echo
## help: show this screen
help: Makefile
@echo
@echo " Choose a command run in "$(PROJECTNAME)":"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo