diff options
| author | Samuel Wilhelmsson <samuel.wilhelmsson@gmail.com> | 2025-01-10 23:47:43 +0100 |
|---|---|---|
| committer | Samuel Wilhelmsson <samuel.wilhelmsson@gmail.com> | 2025-01-10 23:47:43 +0100 |
| commit | 72fec5433610df6e5f405e7f2d8eca1d492c5b2a (patch) | |
| tree | b227375508c6505db00dbc5304ef7ed02800ce8f /deploy | |
| parent | f20103c68fc8ace200577aa0518385467d94f84f (diff) | |
| download | tinygram-72fec5433610df6e5f405e7f2d8eca1d492c5b2a.tar.gz tinygram-72fec5433610df6e5f405e7f2d8eca1d492c5b2a.zip | |
Update deploy script to janet
Update styles with more fancy font
Diffstat (limited to 'deploy')
| -rwxr-xr-x | deploy | 46 |
1 files changed, 31 insertions, 15 deletions
@@ -1,21 +1,37 @@ -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 +#!/usr/bin/env janet +(use sh) -echo "generating templates" -templ generate +(def user "fnurk") +(def host "samuelw.dev") -echo "building" -go build . +(def bin-dir "/opt/tinygram/") +(def asset-dir "/srv/tinygram/") -echo "syncing binary" -rsync --rsync-path 'sudo -u tinygram rsync' tinygram ${USER}@${HOST}:${BIN_DIR} +(def ssh-target (string user "@" host)) -echo "syncing assets" -rsync --rsync-path 'sudo -u tinygram rsync' -r assets ${USER}@${HOST}:${ASSET_DIR} +(def bin-target (string ssh-target ":" bin-dir)) +(def asset-target (string ssh-target ":" asset-dir)) -echo "restarting service" -ssh ${USER}@${HOST} 'sudo systemctl restart tinygram.service' +(def rsync-path ["--rsync-path" "sudo -u tinygram rsync"]) -exit 0 +(def rsync-bin-args [;rsync-path "tinygram" bin-target]) +(def rsync-asset-args [;rsync-path "-r" "assets" asset-target]) + + +(print "-- building templ --") +($ templ generate) + +(print "-- building go --") +($ go build ".") + +(print "-- syncing binary --") +($ rsync ;rsync-bin-args) + +(print "-- syncing assets --") +($ rsync ;rsync-asset-args) + + +(print "-- restarting service --") +($ ssh ,ssh-target "sudo systemctl restart tinygram.service") + +(print "done!") |
