summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel W <samuel.wilhelmsson@gmail.com>2025-01-10 21:17:03 +0100
committerSamuel W <samuel.wilhelmsson@gmail.com>2025-01-10 21:17:03 +0100
commitf20103c68fc8ace200577aa0518385467d94f84f (patch)
treea4b90fd499c6d2ce128038b3c3bb6cdc1fa84a71
parent286509897df2ac44a6e6b2d5d196b782ef2bad6c (diff)
downloadtinygram-f20103c68fc8ace200577aa0518385467d94f84f.tar.gz
tinygram-f20103c68fc8ace200577aa0518385467d94f84f.zip
add deploy script
-rwxr-xr-xdeploy21
1 files changed, 21 insertions, 0 deletions
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