From f20103c68fc8ace200577aa0518385467d94f84f Mon Sep 17 00:00:00 2001 From: Samuel W Date: Fri, 10 Jan 2025 21:17:03 +0100 Subject: add deploy script --- deploy | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 deploy diff --git a/deploy b/deploy new file mode 100755 index 0000000..2946fc8 --- /dev/null +++ b/deploy @@ -0,0 +1,21 @@ +USER=fnurk +HOST=samuelw.dev +BIN_DIR=/opt/tinygram/ # the directory where your binary should go +ASSET_DIR=/srv/tinygram/ # the directory where your asset dir should go + +echo "generating templates" +templ generate + +echo "building" +go build . + +echo "syncing binary" +rsync --rsync-path 'sudo -u tinygram rsync' tinygram ${USER}@${HOST}:${BIN_DIR} + +echo "syncing assets" +rsync --rsync-path 'sudo -u tinygram rsync' -r assets ${USER}@${HOST}:${ASSET_DIR} + +echo "restarting service" +ssh ${USER}@${HOST} 'sudo systemctl restart tinygram.service' + +exit 0 -- cgit v1.2.3