-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
57 lines (47 loc) · 1.29 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
.PHONY: all run
module_name=libredis_state.so
# override
OSNICK?=ubuntu22.04
ARCH?=x86_64
OS?=Linux
REDISVERSION?=7.0.9-1
VERSION?=99.99.99
REDIS_SERVER_PATH?=redis/redis-server
TARGETBASEDIR=target
ifdef RELEASE
RELEASEFLAGS=--release
TARGETDIR=${TARGETBASEDIR}/release
S3TARGET=s3://redismodules/redisstatemachine
else
TARGETDIR=${TARGETBASEDIR}/debug
S3TARGET=s3://redismodules/redisstatemachine/snapshots
endif
module_dest=${TARGETDIR}/${module_name}
all::
cargo build ${RELEASEFLAGS}
run: all
redis-server --loadmodule ${module_dest}
bgtest: all
$(REDIS_SERVER_PATH) --daemonize yes --loadmodule ${module_dest}
pytest --junit-xml=results.xml
redis/redis-cli shutdown
clean:
rm -rf ${module_dest} dump.rdb
distclean:
rm -rf ${TARGETBASEDIR} dump.rdb redis *.zip
deps:
pip3 install -r tests/requirements.txt
curl -s https://redismodules.s3.amazonaws.com/redis-stack/dependencies/redis-${REDISVERSION}-${OS}-${OSNICK}-${ARCH}.tgz --output redis.tgz
tar -xpf redis.tgz
rm *.tgz
mv redis* redis
chmod a+x redis/*
pack:
ramp pack -m ramp.yml target/release/libredis_state.so -o libredis_state.Linux-${OSNICK}-${ARCH}.${VERSION}.zip
ifdef PUBLISH
s3cmd --access_key=${AWS_ACCESS_KEY_ID} \
--secret_key=${AWS_SECRET_ACCESS_KEY} \
--region=${AWS_REGION} \
put -P *.zip \
${S3TARGET}
endif