feat: use cache busting bin and load assets generated by it

This commit is contained in:
realaravinth
2022-05-14 16:00:22 +05:30
parent 0593e254bb
commit 9d7bb3c0be
3 changed files with 29 additions and 82 deletions

View File

@@ -7,23 +7,32 @@ define frontend_env ## install frontend deps
cd docs/openapi && yarn install
endef
define cache_bust ## run cache_busting program
cd utils/cache-bust && cargo run
endef
default: frontend ## Build app in debug mode
cargo build
check: ## Check for syntax errors on all workspaces
cargo check --workspace --tests --all-features
cd utils/cache-bust && cargo check --tests --all-features
cd db/db-migrations && cargo check --tests --all-features
cd db/db-sqlx-postgres &&\
DATABASE_URL=${POSTGRES_DATABASE_URL}\
cargo check
cd db/db-core/ && cargo check
cache-bust: ## Run cache buster on static assets
$(call cache_bust)
clean: ## Delete build artifacts
@cargo clean
@yarn cache clean
@-rm $(CLEAN_UP)
coverage: migrate ## Generate code coverage report in HTML format
$(call cache_bust)
cargo tarpaulin -t 1200 --out Html
doc: ## Generate documentation
@@ -78,6 +87,7 @@ migrate: ## Run database migrations
DATABASE_URL=${POSTGRES_DATABASE_URL} cargo run
release: frontend ## Build app with release optimizations
$(call cache_bust)
cargo build --release
run: frontend ## Run app in debug mode
@@ -94,6 +104,7 @@ sqlx-offline-data: ## prepare sqlx offline data
# && DATABASE_URL=${SQLITE_DATABASE_URL} cargo sqlx prepare
test: frontend-test frontend ## Run all available tests
$(call cache_bust)
cd db/db-sqlx-postgres &&\
DATABASE_URL=${POSTGRES_DATABASE_URL}\
cargo test --no-fail-fast
@@ -101,6 +112,7 @@ test: frontend-test frontend ## Run all available tests
# ./scripts/tests.sh
xml-test-coverage: migrate ## Generate code coverage report in XML format
$(call cache_bust)
cargo tarpaulin -t 1200 --out Xml
help: ## Prints help for targets with comments