-
Notifications
You must be signed in to change notification settings - Fork 9
/
justfile
113 lines (87 loc) · 2.23 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
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
set dotenv-load
export RUST_LOG := 'info'
alias a := all
alias d := dev
alias f := fmt
alias i := initialize
alias t := test
default:
just --list
all: build clippy e2e fmt-check forbid lint test
build *mode='development':
cargo build && pnpm run build -- --mode {{mode}}
build-container:
docker build -t mcgill.courses:latest .
clippy:
./bin/clippy
coverage:
./bin/coverage
dev: services
concurrently \
--kill-others \
--names 'SERVER,CLIENT' \
--prefix-colors 'green.bold,magenta.bold' \
--prefix '[{name}] ' \
--prefix-length 2 \
--success first \
--handle-input \
--timestamp-format 'HH:mm:ss' \
--color \
-- \
'just watch run serve --db-name=mcgill-courses' \
'pnpm run dev'
dev-deps:
cargo install present
e2e:
pnpm run cy:e2e
fmt:
cargo fmt --all
pnpm run format
fmt-check:
cargo fmt --all -- --check
pnpm run format-check
forbid:
./bin/forbid
generate-changelog *args:
cargo run --manifest-path tools/changelog-gen/Cargo.toml \
-- \
--output client/src/assets/changelog.json \
{{args}}
initialize *args: restart-services
cargo run -- --source=seed serve --initialize --db-name=mcgill-courses {{args}}
lint *args:
pnpm run lint {{args}}
load:
cargo run -- --source=seed \
load \
--batch-size=1 \
--scrape-vsb \
--user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36" \
--course-delay 1000 \
--page-delay 1000
readme:
present --in-place README.md
@prettier --write README.md
restart-services:
docker compose down --volumes && just services
run *args:
cargo run -- {{args}}
run-container: build-container
docker run -d \
-e MONGODB_URL=$MONGODB_URL \
-e MS_CLIENT_ID=$MS_CLIENT_ID \
-e MS_CLIENT_SECRET=$MS_CLIENT_SECRET \
-e MS_REDIRECT_URI=$MS_REDIRECT_URI \
-e RUST_LOG=info \
-p 8000:8000 \
mcgill.courses:latest
serve:
cargo run -- serve --db-name=mcgill-courses
services:
docker compose up --no-recreate -d
sleep 5
docker exec mongodb mongosh --quiet --eval 'rs.initiate()' > /dev/null 2>&1 || true
test *filter:
cargo test --all {{filter}}
watch +COMMAND='test':
cargo watch --clear --exec "{{COMMAND}}"