-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
71 lines (56 loc) · 1.56 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
port := env_var_or_default('PORT', '3080')
# Tailwind in watch mode
tailwind:
npx tailwindcss -i ./styles/input.css -o ./styles/output.css --watch
# svg sprite creation
svgstore:
npx svgstore -o templates/icons/sprite.svg static/svg/input/*.svg
server_dev:
cargo watch -x run
# CMS server for local dev
decap_server:
npx decap-server
# Run dev server in watch mode
dev:
#!/usr/bin/env -S parallel --shebang --ungroup --jobs {{ num_cpus() }}
just server_dev
just tailwind
just decap_server
# Run tests
test:
cargo test
test_watch:
cargo watch -x test
# Run server in production mode
prod $TARGET="PROD" $RUST_LOG="info":
cargo run --release
# Wait for port to listen to connections
wait_for_port:
#!/usr/bin/env bash
set -euxo pipefail
while ! nc -z localhost {{port}}; do
sleep 3
done
# Kill the application running on port
kill:
kill $(pidof axum_server)
# Clean the dist folder
clean:
rm -rf dist
# SSG
ssg:
- wget --no-convert-links -r -p -E -P dist --no-host-directories 127.0.0.1:{{port}}
- wget --no-convert-links --content-on-error -p -E -P dist --no-host-directories 127.0.0.1:{{port}}/not-found
- wget --no-convert-links -p -E -P dist --no-host-directories 127.0.0.1:{{port}}/showcase/m-logo-svg
find generated_images/ -name "*_og*" -exec cp --parents {} dist/ \;
# Preview server
preview:
caddy run --config Caddyfile-preview
# SSG export of production server
export: clean
just prod &
just wait_for_port
just ssg
just kill
deploy:
rsync -avz -e ssh ./dist/ michalvanko@katelyn:.config/containers/systemd/michalvankodev-site/dist/