-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathjustfile
45 lines (33 loc) · 937 Bytes
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Set DATABASE_URL:
# export DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:5432
#
# # print the help
help:
just -l
deps:
cargo install sqlx-cli --no-default-features --features native-tls,postgres
url:
@echo export DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:5432
clippy:
cargo +nightly clippy --all-targets --all-features
# run everything that is needed for ci to pass
ci:
just fmt
just clippy
just test
just sqlx-prepare
test:
RUST_LOG=debug cargo nextest run
fmt:
cargo +nightly fmt
sqlx-prepare:
cargo sqlx prepare --workspace -- --all-targets --all-features
psql-up:
@docker run -d --name indexer-rs-psql -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres
@sleep 5
@just migrate
psql-down:
docker stop indexer-rs-psql
docker rm indexer-rs-psql
migrate:
sqlx migrate run --database-url postgresql://postgres:postgres@127.0.0.1:5432