2021-05-03 14:54:03 +00:00
|
|
|
default: frontend
|
2021-04-08 10:19:55 +00:00
|
|
|
cargo build
|
|
|
|
|
2021-07-07 15:40:15 +00:00
|
|
|
clean:
|
|
|
|
cargo clean
|
2021-07-09 08:27:55 +00:00
|
|
|
rm -rf browser/pkg || true
|
2021-07-07 15:40:15 +00:00
|
|
|
rm ./src/cache_buster_data.json || true
|
|
|
|
rm -rf ./static/cache/bundle || true
|
2021-07-09 07:46:54 +00:00
|
|
|
rm -rf ./assets || true
|
2021-07-07 15:40:15 +00:00
|
|
|
|
|
|
|
coverage: migrate
|
|
|
|
cd browser && cargo tarpaulin -t 1200 --out Html
|
|
|
|
cargo tarpaulin -t 1200 --out Html
|
2021-04-08 10:19:55 +00:00
|
|
|
|
|
|
|
dev-env:
|
|
|
|
cargo fetch
|
2021-04-09 08:51:43 +00:00
|
|
|
yarn install
|
2021-04-08 10:19:55 +00:00
|
|
|
|
2021-07-06 18:58:32 +00:00
|
|
|
doc:
|
|
|
|
#yarn doc
|
2021-04-08 10:19:55 +00:00
|
|
|
cargo doc --no-deps --workspace --all-features
|
2021-07-06 18:58:32 +00:00
|
|
|
cd browser && cargo doc --no-deps --workspace --all-features
|
2021-04-09 09:33:50 +00:00
|
|
|
|
2021-07-07 15:40:15 +00:00
|
|
|
docker-build:
|
|
|
|
docker build -t mcaptcha/mcaptcha:master -t mcaptcha/mcaptcha:latest .
|
|
|
|
|
|
|
|
docker-publish: docker-build
|
|
|
|
docker push mcaptcha/mcaptcha:master
|
|
|
|
docker push mcaptcha/mcaptcha:latest
|
|
|
|
|
2021-05-03 14:54:03 +00:00
|
|
|
frontend:
|
2021-07-06 18:58:32 +00:00
|
|
|
cd browser && wasm-pack build --release
|
|
|
|
yarn install
|
2021-04-09 08:51:43 +00:00
|
|
|
yarn build
|
2021-04-08 10:19:55 +00:00
|
|
|
|
2021-07-06 18:58:32 +00:00
|
|
|
frontend-test:
|
|
|
|
cd browser && wasm-pack test --release --headless --chrome
|
|
|
|
cd browser && wasm-pack test --release --headless --firefox
|
2021-07-09 07:46:54 +00:00
|
|
|
cd browser && cargo test
|
2021-07-06 18:58:32 +00:00
|
|
|
yarn test
|
2021-04-08 10:19:55 +00:00
|
|
|
|
2021-07-07 15:40:15 +00:00
|
|
|
migrate:
|
|
|
|
cargo run --bin tests-migrate
|
2021-04-08 10:19:55 +00:00
|
|
|
|
2021-05-03 14:54:03 +00:00
|
|
|
release: frontend
|
2021-04-08 10:19:55 +00:00
|
|
|
cargo build --release
|
|
|
|
|
2021-07-07 15:40:15 +00:00
|
|
|
run: frontend
|
|
|
|
cargo run
|
2021-07-06 18:58:32 +00:00
|
|
|
|
2021-07-09 07:46:54 +00:00
|
|
|
test: frontend-test frontend
|
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-07-07 15:40:15 +00:00
|
|
|
xml-test-coverage: migrate
|
|
|
|
cd browser && cargo tarpaulin -t 1200 --out Xml
|
|
|
|
cargo tarpaulin -t 1200 --out Xml
|
2021-04-08 10:19:55 +00:00
|
|
|
|
|
|
|
help:
|
2021-07-04 20:52:02 +00:00
|
|
|
@echo ' clean - drop builds and environments'
|
|
|
|
@echo ' coverage - build test coverage in HTML format'
|
|
|
|
@echo ' dev-env - download dependencies'
|
|
|
|
@echo ' docker-build - build docker image'
|
|
|
|
@echo ' docker-publish - build and publish docker image'
|
2021-07-06 18:58:32 +00:00
|
|
|
@echo ' doc - build documentation'
|
2021-05-04 05:00:22 +00:00
|
|
|
@echo ' frontend - build static assets in prod mode'
|
2021-07-06 18:58:32 +00:00
|
|
|
@echo ' frontend-test - run frontend tests'
|
2021-07-07 12:50:06 +00:00
|
|
|
@echo ' migrate - run database migrations'
|
2021-07-04 20:52:02 +00:00
|
|
|
@echo ' run - run developer instance'
|
|
|
|
@echo ' test - run unit and integration tests'
|
2021-05-03 14:54:03 +00:00
|
|
|
@echo ' xml-coverage - build test coverage in XML for upload to codecov'
|
2021-04-08 10:19:55 +00:00
|
|
|
@echo ''
|