-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathjustfile
74 lines (55 loc) · 1.69 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Set DATABASE_URL:
# export DATABASE_URL=postgresql://postgres:[email protected]: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:[email protected]: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
review:
RUST_LOG=debug cargo insta review
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:[email protected]:5432
# Development workflow commands
# -----------------------------
# Full setup for testing
# using a local network
setup:
./setup-test-network.sh
# Rebuild binaries and restart services after code changes
reload:
./dev-reload.sh
# Watch log output from services
logs:
@cd contrib && docker compose -f docker-compose.dev.yml logs -f
# Stop all services
down:
@cd contrib && docker compose -f docker-compose.dev.yml down
@cd contrib/local-network && docker compose down
docker rm -f indexer-service tap-agent gateway block-oracle indexer-agent graph-node redpanda tap-aggregator tap-escrow-manager 2>/dev/null || true
test-local:
@cd integration-tests && ./fund_escrow.sh
@cd integration-tests && cargo run