2021-11-29 12:02:33 +00:00
|
|
|
default: frontend ## Build app in debug mode
|
|
|
|
cargo build
|
2021-04-08 10:19:55 +00:00
|
|
|
|
2021-10-08 10:32:35 +00:00
|
|
|
clean: ## Delete build artifacts
|
2021-07-15 09:57:01 +00:00
|
|
|
@cargo clean
|
|
|
|
@yarn cache clean
|
|
|
|
@-rm ./src/cache_buster_data.json
|
|
|
|
@-rm -rf ./static/cache/bundle
|
|
|
|
@-rm -rf ./assets
|
2021-07-07 15:40:15 +00:00
|
|
|
|
2021-10-08 10:32:35 +00:00
|
|
|
coverage: migrate ## Generate code coverage report in HTML format
|
2021-07-07 15:40:15 +00:00
|
|
|
cargo tarpaulin -t 1200 --out Html
|
2021-04-08 10:19:55 +00:00
|
|
|
|
2021-10-08 10:32:35 +00:00
|
|
|
doc: ## Generate documentation
|
2021-07-06 18:58:32 +00:00
|
|
|
#yarn doc
|
2021-04-08 10:19:55 +00:00
|
|
|
cargo doc --no-deps --workspace --all-features
|
2021-04-09 09:33:50 +00:00
|
|
|
|
2021-10-08 10:32:35 +00:00
|
|
|
docker: ## Build Docker image
|
2021-07-07 15:40:15 +00:00
|
|
|
docker build -t mcaptcha/mcaptcha:master -t mcaptcha/mcaptcha:latest .
|
|
|
|
|
2021-10-08 10:32:35 +00:00
|
|
|
docker-publish: docker ## Build and publish Docker image
|
2021-07-07 15:40:15 +00:00
|
|
|
docker push mcaptcha/mcaptcha:master
|
|
|
|
docker push mcaptcha/mcaptcha:latest
|
|
|
|
|
2021-10-08 13:24:10 +00:00
|
|
|
env: ## Setup development environtment
|
|
|
|
cargo fetch
|
|
|
|
yarn install
|
|
|
|
cd docs/openapi && yarn install
|
|
|
|
|
|
|
|
frontend: env ## Build frontend
|
|
|
|
cd docs/openapi/ && yarn build
|
2021-07-06 18:58:32 +00:00
|
|
|
yarn install
|
2021-04-09 08:51:43 +00:00
|
|
|
yarn build
|
2021-11-30 13:15:02 +00:00
|
|
|
@./scripts/librejs.sh
|
2021-04-08 10:19:55 +00:00
|
|
|
|
2021-10-08 10:32:35 +00:00
|
|
|
frontend-test: ## Run frontend tests
|
2021-10-08 10:25:53 +00:00
|
|
|
cd docs/openapi && yarn test
|
2021-07-06 18:58:32 +00:00
|
|
|
yarn test
|
2021-04-08 10:19:55 +00:00
|
|
|
|
2021-10-08 10:32:35 +00:00
|
|
|
lint: ## Lint codebase
|
2021-10-08 10:25:53 +00:00
|
|
|
cargo fmt -v --all -- --emit files
|
|
|
|
cargo clippy --workspace --tests --all-features
|
|
|
|
yarn lint
|
|
|
|
cd docs/openapi && yarn test
|
|
|
|
|
2021-10-08 10:32:35 +00:00
|
|
|
migrate: ## Run database migrations
|
2021-07-07 15:40:15 +00:00
|
|
|
cargo run --bin tests-migrate
|
2021-04-08 10:19:55 +00:00
|
|
|
|
2021-10-08 10:32:35 +00:00
|
|
|
release: frontend ## Build app with release optimizations
|
2021-04-08 10:19:55 +00:00
|
|
|
cargo build --release
|
|
|
|
|
2021-11-29 12:02:33 +00:00
|
|
|
run: frontend ## Run app in debug mode
|
|
|
|
cargo run
|
|
|
|
|
2021-10-08 10:32:35 +00:00
|
|
|
test: frontend-test frontend ## Run all available tests
|
2021-07-09 08:27:55 +00:00
|
|
|
echo 'static/' && tree static || true
|
|
|
|
echo 'tree/' && tree assets || true
|
2021-07-09 07:46:54 +00:00
|
|
|
cargo test --all-features --no-fail-fast
|
2021-07-04 20:52:02 +00:00
|
|
|
|
2021-10-08 10:32:35 +00:00
|
|
|
xml-test-coverage: migrate ## Generate code coverage report in XML format
|
2021-07-07 15:40:15 +00:00
|
|
|
cargo tarpaulin -t 1200 --out Xml
|
2021-04-08 10:19:55 +00:00
|
|
|
|
2021-10-08 10:32:35 +00:00
|
|
|
help: ## Prints help for targets with comments
|
|
|
|
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|