-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
59 lines (47 loc) · 1.76 KB
/
Justfile
File metadata and controls
59 lines (47 loc) · 1.76 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
set positional-arguments
target_release := "x86_64-unknown-linux-musl"
default:
@echo "No default task defined."
just --list
# Builds a example task into a WASM file
build-task task:
rm ./{{task}}.wasm || true
cd ./task/{{task}} && cargo +nightly build --release --target wasm32-wasip2
mv ./target/wasm32-wasip2/release/{{task}}.wasm ./{{task}}.wasm
# Runs the DKC
dkc:
docker pull ghcr.io/leoborai/dkc:latest
docker run -it --rm \
-v $(pwd):/app \
-w /app \
ghcr.io/leoborai/dkc:latest
# Builds docs into static files (docs/book/)
docs-build:
cd ./docs && mdbook build
# Runs server to serve docs locally (http://localhost:3000)
docs-dev:
cd ./docs && mdbook serve
# Builds the Server binary used in the Docker Image
docker-build:
cargo zigbuild --target {{target_release}} --release --bin mate
# Builds the Docker image
docker-build-image: docker-build
mkdir -p ./docker/tmp/
cp ./target/{{target_release}}/release/mate ./docker/tmp/mate
chmod +x ./docker/tmp/mate
docker build -t "mate:$(cargo tag current)" ./docker
# Publishes the Docker image to the GitHub Container Registry
docker-publish-image:
docker tag mate:$(cargo tag current) ghcr.io/leoborai/mate:$(cargo tag current)
docker tag mate:$(cargo tag current) ghcr.io/leoborai/mate:latest
docker push ghcr.io/leoborai/mate:$(cargo tag current)
docker push ghcr.io/leoborai/mate:latest
# Runs the Docker image locally
docker-run-image: docker-build-image
docker run mate:$(cargo tag current)
# Runs clippy and fmt on the entire workspace
fmt:
cargo clippy --fix --workspace --allow-dirty --allow-staged && cargo fmt
# Uses `sqlx` CLI to perform database metadata retrieval
sqlx-prepare:
cargo sqlx prepare --workspace