forked from AntidoteDB/antidote
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
149 lines (117 loc) · 4.1 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
REBAR = $(shell pwd)/rebar3
COVERPATH = $(shell pwd)/_build/test/cover
.PHONY: rel test relgentlerain docker-build docker-run
all: compile
compile:
$(REBAR) compile
clean:
$(REBAR) clean
rm -r _build/default/rel/antidote/antidote* || true
distclean: clean relclean
$(REBAR) clean --all
cleantests:
rm -f test/utils/*.beam
rm -f test/singledc/*.beam
rm -f test/multidc/*.beam
rm -rf logs/
shell: rel
export [email protected] ; \
export COOKIE=antidote ; \
export JAVANODE_NAME=JavaNode; \
export ROOT_DIR_PREFIX=$$NODE_NAME/ ; \
_build/default/rel/antidote/bin/antidote console ${ARGS}
shell2: rel2
export [email protected] ; \
export COOKIE=antidote ; \
export ROOT_DIR_PREFIX=$$NODE_NAME/ ; \
export JAVANODE_NAME=JavaNode2; \
export CONFIG=config2 ; \
_build/default/rel/antidote/bin/antidote console ${ARGS}
shellVar: rel
export NODE_NAME=${NODE_NAME} ; \
export backend_node=${JAVANODE_NAME}@127.0.0.1; \
export JAVANODE_NAME=${JAVANODE_NAME}; \
export COOKIE=antidote ; \
export ROOT_DIR_PREFIX=$$NODE_NAME/ ; \
_build/default/rel/antidote/bin/antidote console ${ARGS}
shellremote: rel
export [email protected]; \
export COOKIE=antidote ; \
export JAVANODE_NAME=JavaNode; \
export ROOT_DIR_PREFIX=$$NODE_NAME/ ; \
_build/default/rel/antidote/bin/antidote console ${ARGS}
#shell:
# $(REBAR) shell --name='[email protected]' --setcookie antidote --config config/sys-debug.config
#shell1:
# $(REBAR) shell --name='[email protected]' --setcookie antidote --config config/sys-debug1.config
# same as shell, but automatically reloads code when changed
# to install add `{plugins, [rebar3_auto]}.` to ~/.config/rebar3/rebar.config
# the tool requires inotifywait (sudo apt install inotify-tools)
# see https://github.com/vans163/rebar3_auto or http://blog.erlware.org/rebar3-auto-comile-and-load-plugin/
#auto:
# $(REBAR) auto --name='[email protected]' --setcookie antidote --config config/sys-debug.config
rel:
export REBAR_CONFIG="rebar.config" ; \
$(REBAR) release
rel2:
export REBAR_CONFIG="rebar2.config" ; \
$(REBAR) release
relclean:
rm -rf _build/default/rel
reltest: rel
test/release_test.sh
# style checks
lint:
${REBAR} as lint lint
check: distclean cleantests test reltest dialyzer lint
relgentlerain: export TXN_PROTOCOL=gentlerain
relgentlerain: relclean cleantests rel
relnocert: export NO_CERTIFICATION=true
relnocert: relclean cleantests rel
stage :
$(REBAR) release -d
compile-utils: compile
for filename in "test/utils/*.erl" ; do \
erlc -o test/utils $$filename ; \
done
test:
${REBAR} eunit skip_deps=true
coverage:
# copy the coverdata files with a wildcard filter
# won't work if there are multiple folders (multiple systests)
cp logs/*/*singledc*/../all.coverdata ${COVERPATH}/singledc.coverdata ; \
cp logs/*/*multidc*/../all.coverdata ${COVERPATH}/multidc.coverdata ; \
${REBAR} cover --verbose
singledc: compile-utils rel
rm -f test/singledc/*.beam
mkdir -p logs
ifdef SUITE
ct_run -pa ./_build/default/lib/*/ebin test/utils/ -logdir logs -suite test/singledc/${SUITE} -cover test/antidote.coverspec
else
ct_run -pa ./_build/default/lib/*/ebin test/utils/ -logdir logs -dir test/singledc -cover test/antidote.coverspec
endif
multidc: compile-utils rel
rm -f test/multidc/*.beam
mkdir -p logs
ifdef SUITE
ct_run -pa ./_build/default/lib/*/ebin test/utils/ -logdir logs -suite test/multidc/${SUITE} -cover test/antidote.coverspec
else
ct_run -pa ./_build/default/lib/*/ebin test/utils/ -logdir logs -dir test/multidc -cover test/antidote.coverspec
endif
systests: singledc multidc
docs:
${REBAR} doc skip_deps=true
xref: compile
${REBAR} xref skip_deps=true
dialyzer:
${REBAR} dialyzer
docker-build:
tmpdir=`mktemp -d` ; \
wget "https://raw.githubusercontent.com/AntidoteDB/docker-antidote/master/local-build/Dockerfile" -O "$$tmpdir/Dockerfile" ; \
docker build -f $$tmpdir/Dockerfile -t antidotedb:local-build .
docker-run: docker-build
docker run -d --name antidote -p "8087:8087" antidotedb:local-build
docker-clean:
ifneq ($(docker images -q antidotedb:local-build 2> /dev/null), "")
docker image rm -f antidotedb:local-build
endif