add justfile

This commit is contained in:
2026-08-24 11:48:06 +01:00
parent 9646803577
commit 2652f09485
2 changed files with 67 additions and 19 deletions
+48
View File
@@ -0,0 +1,48 @@
SERVER := "bl@flo-homeserver"
PKG := "user-to-support-chat"
BINARY := "target/release/user-to-support-chat"
DEV_DIR := "./local"
DEV_BINARY := DEV_DIR + "/user-to-support-chat"
default:
@just --list
build: clippy fmt build-release
build-release:
cargo build --release
deploy: build
ssh {{SERVER}} "rm -rf /tmp/{{PKG}}-deploy && mkdir -p /tmp/{{PKG}}-deploy"
rsync -avz --delete {{BINARY}} {{SERVER}}:/tmp/{{PKG}}-deploy/
ssh -t {{SERVER}} "sudo rsync -a --delete --exclude='.env' --exclude='config.json' --exclude='data/' --chown={{PKG}}:{{PKG}} /tmp/{{PKG}}-deploy/ /opt/{{PKG}}/ && sudo systemctl restart {{PKG}}"
ssh {{SERVER}} "rm -rf /tmp/{{PKG}}-deploy"
dev-build: clippy fmt dev-build-debug
dev-build-debug:
mkdir -p {{DEV_DIR}}
cargo build
dev-start:
rm -rf {{DEV_DIR}}
mkdir -p {{DEV_DIR}}
cargo build
cp target/debug/{{PKG}} {{DEV_BINARY}}
cd {{DEV_DIR}} && ./{{PKG}}
run:
cargo run
clippy:
cargo clippy -- -D warnings
fmt:
cargo fmt
test:
cargo test
clean:
cargo clean
rm -rf {{DEV_DIR}}