librepages/Makefile

72 lines
1.8 KiB
Makefile
Raw Normal View History

2022-09-16 17:41:11 +05:30
define cache_bust ## run cache_busting program
npm run sass
cd utils/cache-bust && cargo run
endef
2021-10-29 20:24:20 +05:30
default: ## Debug build
2022-09-16 17:41:11 +05:30
$(call cache_bust)
cargo run -- serve
cache-bust: ## Run cache buster on static assets
$(call cache_bust)
2021-10-29 20:24:20 +05:30
2022-09-07 10:27:44 +05:30
check: ## Check for syntax errors on all workspaces
cargo check --workspace --tests --all-features
#cd utils/cache-bust && cargo check --tests --all-features
2021-10-29 20:24:20 +05:30
clean: ## Clean all build artifacts and dependencies
@cargo clean
coverage: ## Generate HTML code coverage
2022-09-16 17:41:11 +05:30
$(call cache_bust)
2021-10-29 20:24:20 +05:30
cargo tarpaulin -t 1200 --out Html
dev-env: ## Download development dependencies
2022-09-16 17:41:11 +05:30
npm install
2021-10-29 20:24:20 +05:30
cargo fetch
doc: ## Prepare documentation
cargo doc --no-deps --workspace --all-features
docker: ## Build docker images
docker build \
-t realaravinth/pages:master \
-t realaravinth/pages:latest \
-t realaravinth/pages:0.1.0 .
2021-10-29 20:24:20 +05:30
docker-publish: docker ## Build and publish docker images
docker push realaravinth/pages:master
docker push realaravinth/pages:latest
docker push realaravinth/pages:0.1.0
2021-10-29 20:24:20 +05:30
lint: ## Lint codebase
cargo fmt -v --all -- --emit files
cargo clippy --workspace --tests --all-features
2022-09-10 19:29:22 +05:30
migrate: ## run migrations
unset DATABASE_URL && cargo build
cargo run -- migrate
2021-10-29 20:24:20 +05:30
release: ## Release build
2022-09-16 17:41:11 +05:30
$(call cache_bust)
2021-10-29 20:24:20 +05:30
cargo build --release
run: default ## Run debug build
2022-09-16 13:22:45 +05:30
cargo run -- serve
2021-10-29 20:24:20 +05:30
2022-09-10 19:29:22 +05:30
sqlx-offline-data: ## prepare sqlx offline data
cargo sqlx prepare \
--database-url=${DATABASE_URL} -- \
--all-features
2021-10-29 20:24:20 +05:30
test: ## Run tests
2022-09-16 17:41:11 +05:30
$(call cache_bust)
2021-10-29 20:24:20 +05:30
cargo test --all-features --no-fail-fast
xml-test-coverage: ## Generate cobertura.xml test coverage
2022-09-16 17:41:11 +05:30
$(call cache_bust)
2021-10-29 20:24:20 +05:30
cargo tarpaulin -t 1200 --out Xml
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}'