-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
147 lines (106 loc) · 2.84 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
ifdef CI
REBAR=$(shell whereis rebar3 | awk '{print $$2}')
else
REBAR=$(shell pwd)/rebar3
endif
COVERPATH = $(shell pwd)/_build/test/cover
.PHONY: rel test relgentlerain docker-build docker-run
all: compile
compile: compile-vaxine compile-vax
compile-vaxine:
$(REBAR) compile
compile-vax:
make compile -C apps/vax
clean: clean-vaxine clean-vax
clean-vaxine:
$(REBAR) clean
clean-vax:
make clean -C apps/vax
distclean: clean relclean
$(REBAR) clean --all
shell: rel
export [email protected] ; \
export COOKIE=antidote ; \
export ROOT_DIR_PREFIX=$$NODE_NAME/ ; \
_build/default/rel/vaxine/bin/vaxine console ${ARGS}
rel:
$(REBAR) release
relclean:
rm -rf _build/default/rel
reltest: rel
test/release_test.sh
# style checks
lint:
${REBAR} lint
${REBAR} fmt --check
check: distclean test reltest dialyzer lint
relgentlerain: export TXN_PROTOCOL=gentlerain
relgentlerain: relclean rel
relnocert: export NO_CERTIFICATION=true
relnocert: relclean rel
stage :
$(REBAR) release -d
test: test-vaxine test-vax
ifdef EUNIT_MODS
EUNIT_MODULES=--module=${EUNIT_MODS}
endif
test-vaxine:
${REBAR} eunit --verbose ${EUNIT_MODULES}
test-vax:
make test -C apps/vax
proper:
${REBAR} proper
coverage:
${REBAR} cover --verbose
singledc:
ifdef SUITE
${REBAR} ct --dir apps/antidote/test/singledc --verbose --suite ${SUITE}
else
${REBAR} ct --dir apps/antidote/test/singledc --verbose --cover_export_name=singledc
endif
multidc:
ifdef SUITE
${REBAR} ct --dir apps/antidote/test/multidc --verbose --suite ${SUITE}
else
${REBAR} ct --dir apps/antidote/test/multidc --verbose --cover_export_name=multidc
endif
systests: singledc multidc test_vx_ct
ifdef SUITE
SUITE_OPT=--suite ${SUITE}
endif
test_vx_ct:
${REBAR} ct --verbose --dir apps/vx_server/test --cover --cover_export_name=vx_dc ${SUITE_OPT}
docs:
${REBAR} doc skip_deps=true
xref: compile
${REBAR} xref skip_deps=true
dialyzer: dialyzer-vaxine dialyzer-vax
dialyzer-vaxine:
${REBAR} dialyzer
dialyzer-vax:
make dialyzer -C apps/vax
CONTAINER_NAME=vaxine
docker-build:
docker build -f Dockerfile.vaxine -t vaxine:local-build .
docker-run: docker-build
docker run --rm -d --name ${CONTAINER_NAME} \
-p "8087:8087" \
-p "8088:8088" \
vaxine:local-build
docker-clean:
ifneq ($(docker images -q vaxine:local-build 2> /dev/null), "")
docker image rm -f vaxine:local-build
endif
docker-stop:
docker stop ${CONTAINER_NAME}
send-coverage:
${REBAR} as test coveralls send
ifdef BUILDKITE_COMMIT
IMAGE_TAG ?= $(shell git describe --abbrev=7 --tags --always --first-parent)
buildkite-build-and-push:
ARG=""; \
if [ "${BUILDKITE_BRANCH}" = "main" ] || [ "${TAG_AS_LATEST}" = "true" ]; then \
ARG="-t ${DOCKER_REPO}/${IMAGE_NAME}:latest"; \
fi; \
docker buildx build --platform linux/arm64/v8,linux/amd64 --push -f Dockerfile.vaxine $$ARG -t ${DOCKER_REPO}/${IMAGE_NAME}:${IMAGE_TAG} .
endif