-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
78 lines (67 loc) · 2.29 KB
/
Copy pathJustfile
File metadata and controls
78 lines (67 loc) · 2.29 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
set dotenv-load := false
venv_dir := ".venv"
venv_bin := venv_dir / "bin"
compose := "docker compose -f deploy/docker-compose.yml -f deploy/docker-compose.local.yml"
# List available recipes
default:
@just --list
# Initialize git submodules
[private]
setup-submodules:
git submodule update --init --recursive
# Create venv and install Python dependencies
[private]
setup-venv:
#!/usr/bin/env bash
set -euo pipefail
if [ ! -d "{{ venv_dir }}" ]; then
echo "==> Creating virtualenv..."
python3 -m venv "{{ venv_dir }}"
fi
"{{ venv_bin }}/pip" install -q .
# Generate .env from manifesto and download CLI
[private]
setup-env: setup-venv
#!/usr/bin/env bash
set -euo pipefail
export PATH="{{ venv_bin }}:$PATH"
./scripts/local-up.sh --env
# Start the full dev environment (containers + contracts + indexer)
start-dev-env: setup-submodules setup-env
#!/usr/bin/env bash
set -euo pipefail
./scripts/local-up.sh --up
./scripts/local-up.sh --deploy-contracts
# Run integration tests (extra args passed through, e.g. just test -k test_credit).
# For parallel runs across test modules: just test -n auto --dist loadscope
# (loadscope keeps a module's tests on one worker so each module's shared VM is
# created once; different modules run concurrently — a larger CRN hosts many VMs).
test *args='': setup-env
#!/usr/bin/env bash
set -euo pipefail
export PATH="{{ venv_bin }}:$PATH"
./scripts/local-up.sh --test {{ args }}
# Stop all containers (state is preserved for quick restart)
stop-dev-env:
{{ compose }} --profile credits --profile nodestatus --profile scheduler stop
# Stop containers and wipe all state (volumes, keys, configs)
reset-dev-env:
#!/usr/bin/env bash
set -euo pipefail
./scripts/local-up.sh --down
rm -rf "{{ venv_dir }}"
echo "==> Dev environment fully reset."
# Show container logs
logs:
./scripts/local-up.sh --logs
# Remove all generated files (venv, build artifacts, caches)
clean:
#!/usr/bin/env bash
set -euo pipefail
rm -rf "{{ venv_dir }}"
rm -rf .local bin results.xml
rm -f deploy/.env deploy/config.yml
rm -rf deploy/indexer
rm -rf contracts/broadcast contracts/out contracts/cache
rm -rf __pycache__ tests/__pycache__ *.egg-info
echo "==> Clean."