mCaptcha-cache/Makefile

70 lines
1.8 KiB
Makefile
Raw Normal View History

VERSION = "0.1.0:alpha-test"
2021-06-05 14:58:43 +03:00
DOCKER_IMG = "mcaptcha/cache$(VERSION)"
2021-06-05 14:44:51 +03:00
DOCKER_CONTAINER = "mcaptcha_cache_test"
2021-06-05 14:26:35 +03:00
default:
cargo build --release
2021-06-09 17:11:58 +03:00
bench:
./scripts/bench.sh
clean:
cargo clean
coverage:
cargo tarpaulin -t 1200 --out Html --all --all-features --no-fail-fast
dev:
cargo build
doc:
cargo doc --no-deps --workspace --all-features --document-private-items
docker:
docker build -t mcaptcha/cache:0.1.0-beta -t mcaptcha/cache:latest .
docker push mcaptcha/cache:0.1.0-beta
docker push mcaptcha/cache:latest
2021-06-05 14:26:35 +03:00
docker-build:
2021-06-05 14:44:51 +03:00
docker build -t $(DOCKER_IMG) .
2021-06-05 14:26:35 +03:00
docker-run:
2021-06-05 14:44:51 +03:00
docker run --detach --name=$(DOCKER_CONTAINER) \
2021-06-05 14:26:35 +03:00
--publish 6379:6379 \
$(DOCKER_IMG)
2021-06-05 14:26:35 +03:00
2021-06-09 17:11:58 +03:00
docker-stop:
docker stop $(DOCKER_CONTAINER) || true
docker rm $(DOCKER_CONTAINER)
env:
2021-06-05 14:26:35 +03:00
./scripts/setup.sh
test:
2021-06-09 17:11:58 +03:00
cargo test --all --all-features --no-fail-fast
./tests/test.py
2021-06-05 14:26:35 +03:00
xml-test-coverage:
cargo tarpaulin -t 1200 --out Xml --all --all-features --no-fail-fast
2021-06-09 17:11:58 +03:00
run-redis:
redis-server --loadmodule ./target/release/libcache.so &
2021-06-06 20:42:27 +03:00
2021-06-09 17:11:58 +03:00
stop-redis:
killall redis-server
2021-06-05 14:26:35 +03:00
help:
2021-06-09 17:11:58 +03:00
@echo ' bench - run benchmarks'
@echo ' clean - drop builds and environments'
@echo ' coverage - build test coverage in HTML format'
@echo ' doc - build documentation'
2021-06-05 14:26:35 +03:00
@echo ' docker-build - build docker image'
@echo ' docker-run - run docker container'
@echo ' docker-stop - stop docker container'
2021-06-09 17:11:58 +03:00
@echo ' env - setup dev env'
@echo ' run-redis - load and run redis on local machine'
@echo ' stop-redis - kill local redis instance'
@echo ' test - run unit and integration tests'
2021-06-05 14:26:35 +03:00
@echo ' xml-coverage - build test coverage in XML for upload to codecov'
@echo ''