-
Notifications
You must be signed in to change notification settings - Fork 1
/
justfile
73 lines (56 loc) · 1.85 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
set dotenv-load
# List available commands
default:
just -l
alias u := update
# Script to run the Tailwind binary in watch mode
run-tailwind:
#!/bin/bash
echo "Starting the Tailwind binary."
./tailwindcss -i ./src/styles/styles.css -o ./assets/styles.css --watch
# Script to build and minify the Tailwind binary
build-tailwind:
#!/bin/bash
echo -e "\nMinifying css"
sh -c './tailwindcss -i ./src/styles/styles.css -o ./assets/styles.css --minify'
build-cv:
#!/bin/bash
echo -e "\nBuilding resume"
typst compile ./content/cv.typ ./assets/austin_rooks_cv.pdf
echo -e "\nDone :)"
# Script to run the axum server in watch mode.
run-axum:
#!/bin/bash
echo "Starting the Axum server."
export API_TOKEN=$API_TOKEN
# Start cargo watch in the background
sh -c 'cargo watch -w src -w templates -w content -x run'
# Script to run the axum server and tailwind binary in watch mode so updates
# will automatically be reflected. On exit, will minify tailwind's css.
#
# Install Just and run with `just dev`
dev:
#!/bin/bash
minify() {
just build-tailwind
}
# Add a trap to run the minify function before exiting
trap "minify; kill 0" SIGINT
open 'http://127.0.0.1:1111'
just run-axum & just run-tailwind
TAILWIND_PID=$!
wait $TAILWIND_PID
# Update dependencies and run the tests.
update:
#!/bin/bash
cargo update
echo $'Dependencies updated!\n'
cargo test
# Builds the docker image
docker-build:
docker buildx build --platform linux/arm64/v8 --tag bl0g --file Dockerfile .
docker-deploy:
DOCKER_HOST="ssh://[email protected]" docker compose up -d
# Builds the new images, saves it to the pi, remotely starts it up with docker compose
deploy:
just docker-build && docker save bl0g | bzip2 | ssh [email protected] docker load && just docker-deploy