-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathjustfile
More file actions
136 lines (115 loc) · 3.23 KB
/
justfile
File metadata and controls
136 lines (115 loc) · 3.23 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
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Default target listing all commands
default:
@echo "Available commands:"
@just --list
# ========= Container Commands =========
# Run compose
run-compose:
@echo "Running compose..."
docker compose -f deployment/compose.yml up --build -d
# ========= Build Commands =========
# Build SDK
build-sdk:
@echo "Building SDK..."
cargo build -p sdk --release
# Build Server
build-server:
@echo "Building Server..."
cargo build -p server --release
# Build Credit-Sales Program
build-credit-sales:
@echo "Building Credit-Sales Program..."
cargo build-sbf --manifest-path credit-sales/Cargo.toml
# Build Frontend
build-frontend:
@echo "Building Frontend..."
cd frontend && yarn build
# Build All
build-all:
@echo "Building all projects..."
just build-sdk
just build-credit-sales
just build-server
just build-frontend
# ========= Run Commands =========
# Run Server
run-server:
@echo "Running Server..."
cd server && cargo run --release
# Run-watch
run-watch:
@echo "Running Server with watch..."
cd server && cargo watch -x 'run --release'
# Run Frontend
run-frontend:
@echo "Running Frontend..."
cd frontend && yarn && yarn dev
# Run All
run-all:
@echo "Running all services..."
just run-server & just run-frontend
# Run AI Agent
run-agent:
@echo "Running AI Agent..."
cd ai-agent && \
python3 -m venv .venv && \
source .venv/bin/activate && \
pip install -r requirements.txt && \
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
# ========= Test Commands =========
# Test SDK
test-sdk:
@echo "Testing SDK..."
cargo test -p sdk -- --nocapture
# Test Credit-Sales
test-credit-sales:
@echo "Testing Credit-Sales Program..."
cargo test-sbf --manifest-path credit-sales/Cargo.toml -- --nocapture
# Test Server
test-server:
@echo "Testing Server..."
cargo test -p server
# Test All
test-all:
@echo "Testing all projects..."
just test-sdk
just test-credit-sales
just test-server
# ========= Clean Commands =========
# Clean SDK
clean-sdk:
@echo "Cleaning SDK..."
cargo clean -p sdk
# Clean Credit-Sales Program
clean-credit-sales:
@echo "Cleaning Credit-Sales Program..."
cargo clean --manifest-path credit-sales/Cargo.toml
# Clean Server
clean-server:
@echo "Cleaning Server..."
cargo clean -p server
# Clean All
clean-all:
@echo "Cleaning all projects..."
cargo clean
just clean-sdk
just clean-credit-sales
just clean-server
# ========= Check and Format Commands =========
# Check and Format All
check-fmt:
@echo "Checking and formatting..."
cargo check -p swquery
cargo check --manifest-path credit-sales/Cargo.toml
cargo check -p server
cargo +nightly fmt --all
# ========= Database Commands =========
# Reset Database (completely removes container, image, volumes and starts fresh)
reset-db:
@echo "Completely resetting database..."
docker compose -f deployment/compose.yml down swquery-db
docker container rm -f swquery-db || true
docker volume rm -f swquery_swquery-db-data || true
docker rmi postgres:12 || true
docker compose -f deployment/compose.yml up -d swquery-db
@echo "Database has been completely reset and reinitialized"