-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
189 lines (135 loc) · 4.99 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
BASEDIR = $(shell pwd)
REBAR = $(BASEDIR)/rebar3
BASIC_PROFILE = default
DEV_PROFILE = default
RELPATH = _build/$(BASIC_PROFILE)/rel/grb
DEV1RELPATH = _build/$(DEV_PROFILE)/rel/grb_local1
DEV2RELPATH = _build/$(DEV_PROFILE)/rel/grb_local2
DEV3RELPATH = _build/$(DEV_PROFILE)/rel/grb_local3
DEV4RELPATH = _build/$(DEV_PROFILE)/rel/grb_local4
DEVRINGSIZE=4
APPNAME = grb
ENVFILE = env
SHELL = /bin/bash
.PHONY: test
all: compile
compile:
$(REBAR) as $(BASIC_PROFILE) compile
check_binaries:
$(REBAR) as debug_bin compile
xref:
- $(REBAR) xref skip_deps=true
- $(REBAR) as cure xref skip_deps=true
- $(REBAR) as ft_cure xref skip_deps=true
- $(REBAR) as uniform_blue xref skip_deps=true
dialyzer:
- $(REBAR) dialyzer
- $(REBAR) as cure dialyzer
- $(REBAR) as ft_cure dialyzer
- $(REBAR) as uniform_blue dialyzer
debug:
$(REBAR) as debug_log compile
cure:
$(REBAR) as cure compile
ft_cure:
$(REBAR) as ft_cure compile
uniform:
$(REBAR) as uniform_blue compile
clean:
$(REBAR) clean --all
rel: compile
$(REBAR) as $(BASIC_PROFILE) release -n grb
debugrel:
$(REBAR) as debug_log release -n grb
curerel:
$(REBAR) as cure release -n grb
ft_curerel:
$(REBAR) as ft_cure release -n grb
unirel:
$(REBAR) as uniform_blue release -n grb
debugrel-clean:
rm -rf _build/debug_log/rel
console:
$(BASEDIR)/$(RELPATH)/bin/$(ENVFILE) console
relclean:
rm -rf $(BASEDIR)/$(RELPATH)
start:
$(BASEDIR)/$(RELPATH)/bin/$(ENVFILE) daemon
ping:
$(BASEDIR)/$(RELPATH)/bin/$(ENVFILE) ping
stop:
$(BASEDIR)/$(RELPATH)/bin/$(ENVFILE) stop
attach:
$(BASEDIR)/$(RELPATH)/bin/$(ENVFILE) daemon_attach
test:
${REBAR} eunit skip_deps=true
${REBAR} as cure eunit skip_deps=true
${REBAR} as ft_cure eunit skip_deps=true
${REBAR} as uniform_blue eunit skip_deps=true
ct:
$(REBAR) as $(BASIC_PROFILE) ct --fail_fast
full_ct: ct
$(REBAR) as cure ct --fail_fast
$(REBAR) as ft_cure ct --fail_fast
$(REBAR) as uniform_blue ct --fail_fast
ct_clean:
rm -rf $(BASEDIR)/_build/test/logs
rm -rf $(BASEDIR)/_build/cure+test/logs
rm -rf $(BASEDIR)/_build/ft_cure+test/logs
rm -rf $(BASEDIR)/_build/uniform_blue+test/logs
dev1-rel:
$(REBAR) as $(DEV_PROFILE) release -n grb_local1
dev2-rel:
$(REBAR) as $(DEV_PROFILE) release -n grb_local2
dev3-rel:
$(REBAR) as $(DEV_PROFILE) release -n grb_local3
dev4-rel:
$(REBAR) as $(DEV_PROFILE) release -n grb_local4
devrel: dev1-rel dev2-rel dev3-rel dev4-rel
dev1-attach:
INSTANCE_NAME=grb_local1 $(BASEDIR)/$(DEV1RELPATH)/bin/$(ENVFILE) daemon_attach
dev2-attach:
INSTANCE_NAME=grb_local2 $(BASEDIR)/$(DEV2RELPATH)/bin/$(ENVFILE) daemon_attach
dev3-attach:
INSTANCE_NAME=grb_local3 $(BASEDIR)/$(DEV3RELPATH)/bin/$(ENVFILE) daemon_attach
dev4-attach:
INSTANCE_NAME=grb_local4 $(BASEDIR)/$(DEV4RELPATH)/bin/$(ENVFILE) daemon_attach
devrelclean:
rm -rf _build/$(DEV_PROFILE)/rel/grb_local*
dev1-start:
RIAK_RING_SIZE=$(DEVRINGSIZE) INSTANCE_NAME=grb_local1 RIAK_HANDOFF_PORT=8199 TCP_LIST_PORT=7891 INTER_DC_PORT=8991 $(BASEDIR)/$(DEV1RELPATH)/bin/$(ENVFILE) daemon
dev2-start:
RIAK_RING_SIZE=$(DEVRINGSIZE) INSTANCE_NAME=grb_local2 RIAK_HANDOFF_PORT=8299 TCP_LIST_PORT=7892 INTER_DC_PORT=8992 $(BASEDIR)/$(DEV2RELPATH)/bin/$(ENVFILE) daemon
dev3-start:
RIAK_RING_SIZE=$(DEVRINGSIZE) INSTANCE_NAME=grb_local3 RIAK_HANDOFF_PORT=8399 TCP_LIST_PORT=7893 INTER_DC_PORT=8993 $(BASEDIR)/$(DEV3RELPATH)/bin/$(ENVFILE) daemon
dev4-start:
RIAK_RING_SIZE=$(DEVRINGSIZE) INSTANCE_NAME=grb_local4 RIAK_HANDOFF_PORT=8499 TCP_LIST_PORT=7894 INTER_DC_PORT=8994 $(BASEDIR)/$(DEV4RELPATH)/bin/$(ENVFILE) daemon
devstart: clean devrelclean devrel dev1-start dev2-start dev3-start dev4-start
dev1-ping:
INSTANCE_NAME=grb_local1 $(BASEDIR)/$(DEV1RELPATH)/bin/$(ENVFILE) ping
dev2-ping:
INSTANCE_NAME=grb_local2 $(BASEDIR)/$(DEV2RELPATH)/bin/$(ENVFILE) ping
dev3-ping:
INSTANCE_NAME=grb_local3 $(BASEDIR)/$(DEV3RELPATH)/bin/$(ENVFILE) ping
dev4-ping:
INSTANCE_NAME=grb_local4 $(BASEDIR)/$(DEV4RELPATH)/bin/$(ENVFILE) ping
devping: dev1-ping dev2-ping dev3-ping dev4-ping
dev1-stop:
INSTANCE_NAME=grb_local1 $(BASEDIR)/$(DEV1RELPATH)/bin/$(ENVFILE) stop
dev2-stop:
INSTANCE_NAME=grb_local2 $(BASEDIR)/$(DEV2RELPATH)/bin/$(ENVFILE) stop
dev3-stop:
INSTANCE_NAME=grb_local3 $(BASEDIR)/$(DEV3RELPATH)/bin/$(ENVFILE) stop
dev4-stop:
INSTANCE_NAME=grb_local4 $(BASEDIR)/$(DEV4RELPATH)/bin/$(ENVFILE) stop
devstop: dev1-stop dev2-stop dev3-stop dev4-stop
devfulljoin:
./bin/join_cluster_script.erl -c 'dev_test_1_2' '[email protected]' '[email protected]'
./bin/join_cluster_script.erl -c 'dev_test_3_4' '[email protected]' '[email protected]'
./bin/connect_dcs.erl '[email protected]' '[email protected]'
devreplicas:
./bin/join_cluster_script.erl -c 'dev_test_1' '[email protected]'
./bin/join_cluster_script.erl -c 'dev_test_2' '[email protected]'
./bin/join_cluster_script.erl -c 'dev_test_3' '[email protected]'
./bin/join_cluster_script.erl -c 'dev_test_4' '[email protected]'
./bin/connect_dcs.erl '[email protected]' '[email protected]' '[email protected]' '[email protected]'