From 2652f0948537493c03e39274373fb71d3f7f2a5e Mon Sep 17 00:00:00 2001 From: Bartal Laearsson Date: Mon, 24 Aug 2026 11:48:06 +0100 Subject: [PATCH] add justfile --- Cargo.lock | 38 +++++++++++++++++++------------------- justfile | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 19 deletions(-) create mode 100644 justfile diff --git a/Cargo.lock b/Cargo.lock index e770be3..ae6942e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -186,25 +186,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" -[[package]] -name = "chat-service" -version = "0.0.1" -dependencies = [ - "axum", - "chrono", - "dashmap", - "idna 0.5.0", - "serde", - "serde_json", - "tokio", - "tower", - "tower-http", - "tracing", - "tracing-subscriber", - "url", - "uuid", -] - [[package]] name = "chrono" version = "0.4.35" @@ -1242,6 +1223,25 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "user-to-support-chat" +version = "0.1.1" +dependencies = [ + "axum", + "chrono", + "dashmap", + "idna 0.5.0", + "serde", + "serde_json", + "tokio", + "tower", + "tower-http", + "tracing", + "tracing-subscriber", + "url", + "uuid", +] + [[package]] name = "utf-8" version = "0.7.6" diff --git a/justfile b/justfile new file mode 100644 index 0000000..a901ef6 --- /dev/null +++ b/justfile @@ -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}}