conductor/Makefile

68 lines
1.8 KiB
Makefile
Raw Normal View History

define lint
cargo fmt -v --all -- --emit files
cargo clippy --workspace --tests --all-features
endef
define test
cargo test --no-fail-fast --workspace --tests --all-features
endef
2022-10-05 16:09:00 +05:30
default: ## Build app in debug mode
cargo build
check: ## Check for syntax errors on all workspaces
cargo check --workspace --tests --all-features
clean: ## Delete build artifacts
@cargo clean
coverage: ## Generate code coverage report in HTML format
cargo tarpaulin -t 1200 --out Html
doc: ## Generate documentation
#yarn doc
cargo doc --no-deps --workspace --all-features
docker: ## Build Docker image
docker build -t realaravinth/librepages-conductor:master -t realaravinth/librepages-conductor:latest .
docker-publish: docker ## Build and publish Docker image
docker push realaravinth/librepages-conductor:master
docker push realaravinth/librepages-conductor:latest
env: ## Setup development environtment
cargo fetch
lint: ## Lint codebase
$(call lint)
cd env/dummy_conductor && $(call lint)
cd env/nginx_bind_le && $(call lint)
cd env/libconductor && $(call lint)
2022-10-05 16:09:00 +05:30
#migrate: ## run migrations
# unset DATABASE_URL && cargo build
# cargo run -- migrate
release: ## Build app with release optimizations
cargo build --release
run: ## Run app in debug mode
2022-12-11 23:43:13 +05:30
cargo run -- serve
2022-10-05 16:09:00 +05:30
#sqlx-offline-data: ## prepare sqlx offline data
# cargo sqlx prepare \
# --database-url=${POSTGRES_DATABASE_URL} -- \
# --all-features
test: ## Run all available tests
$(call test)
cd env/dummy_conductor && $(call test)
cd env/nginx_bind_le && $(call test)
2022-10-05 16:09:00 +05:30
xml-test-coverage: ## Generate code coverage report in XML format
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}'