2023-03-09 15:59:45 +00:00
|
|
|
PHONY: db, clippy, diesel, stop, tests, ignored, doc
|
|
|
|
|
|
|
|
DATABASE_URL := postgres://postgres:password@localhost/backie
|
|
|
|
|
2022-08-29 16:59:22 +00:00
|
|
|
db:
|
2023-03-09 15:59:45 +00:00
|
|
|
docker run --rm -d --name backie-db -p 5432:5432 \
|
|
|
|
-e POSTGRES_DB=backie \
|
|
|
|
-e POSTGRES_USER=postgres \
|
|
|
|
-e POSTGRES_PASSWORD=password \
|
|
|
|
postgres:latest
|
|
|
|
|
2022-08-29 16:59:22 +00:00
|
|
|
clippy:
|
2023-03-09 15:59:45 +00:00
|
|
|
cargo clippy --tests -- -D clippy::all
|
|
|
|
|
2022-08-29 16:59:22 +00:00
|
|
|
diesel:
|
2023-03-09 15:59:45 +00:00
|
|
|
DATABASE_URL=$(DATABASE_URL) diesel migration run
|
|
|
|
|
2022-08-29 16:59:22 +00:00
|
|
|
stop:
|
2023-03-09 15:59:45 +00:00
|
|
|
docker kill backie-db
|
2022-08-29 16:59:22 +00:00
|
|
|
|
2023-03-09 15:59:45 +00:00
|
|
|
tests:
|
|
|
|
DATABASE_URL=$(DATABASE_URL) cargo test --all-features -- --color always --nocapture --test-threads 1
|
2022-09-03 11:05:58 +00:00
|
|
|
|
|
|
|
doc:
|
|
|
|
cargo doc --open
|