add justfile
This commit is contained in:
@@ -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}}
|
||||
Reference in New Issue
Block a user