-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
43 lines (32 loc) · 1.13 KB
/
justfile
File metadata and controls
43 lines (32 loc) · 1.13 KB
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
# Define variables
set dotenv-required
DB_CONTAINER_NAME := "mina-mesh-db"
# Download archive DB dump
dl network:
./tasks/dl.sh --network {{network}}
# Initialize PostgreSQL database
pg-init:
docker run -d --name {{DB_CONTAINER_NAME}} -p $POSTGRES_PORT:5432 -v $(pwd)/sql_scripts:/docker-entrypoint-initdb.d -e POSTGRES_PASSWORD=$POSTGRES_PASSWORD -e POSTGRES_USER=$POSTGRES_USER postgres postgres -c log_statement=all -c log_min_duration_statement=0
# Wait for PostgreSQL to be ready
pg-wait:
./tasks/pg_wait.sh $DATABASE_URL
# Apply optimizations to PostgreSQL
pg-apply-optimizations:
sqlx migrate run --source sql/migrations
# Drop optimizations from PostgreSQL
pg-drop-optimizations:
sqlx migrate revert --source sql/migrations
# Start PostgreSQL container
pg-up:
docker start {{DB_CONTAINER_NAME}}
# Stop PostgreSQL container
pg-down:
docker kill {{DB_CONTAINER_NAME}}
# Remove PostgreSQL container
pg-rm:
docker rm {{DB_CONTAINER_NAME}}
# Initialize development environment
dev-init: (dl "devnet") pg-init pg-wait pg-apply-optimizations
# Run the development server
dev:
cargo run serve --playground