diff options
| author | unwox <me@unwox.com> | 2024-11-26 15:35:35 +0600 |
|---|---|---|
| committer | unwox <me@unwox.com> | 2024-11-27 17:33:45 +0600 |
| commit | cd8e3249f0e41372a2748ee8554e431d152cea01 (patch) | |
| tree | 459c4552e673e5c9b4ea39a8c0e6c536424734ad /run.sh | |
init
Diffstat (limited to 'run.sh')
| -rwxr-xr-x | run.sh | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -0,0 +1,37 @@ +#!/bin/sh +set -e + +usage () { + echo "Usage: + serve [--jit] Serve the site pages + deploy Deploy changes to the production server" +} + +serve () { + variant="$1" + if [ "$variant" = "--jit" ]; then + echo "running jit" + go run -tags jit ../. -n 1 main.lua bin/serve.fnl + else + echo "running puc" + LUA_CPATH="/usr/local/lib/lua/5.4/?.so;/usr/local/lib/lua/5.4/loadall.so;./?.so;$(guix build lua-lpeg)/lib/lua/5.3/?.so" \ + go run -tags puc ../. -n 1 main.lua bin/serve.fnl + fi +} + +deploy () { + git stash -u + scp -r bin root@everytea.ru:~/whitetoad.ru/ + scp -r pages root@everytea.ru:~/whitetoad.ru/ + scp -r static root@everytea.ru:~/whitetoad.ru/ + scp -r vendor root@everytea.ru:~/whitetoad.ru/ + scp templates.fnl root@everytea.ru:~/whitetoad.ru/ + scp main.lua root@everytea.ru:~/whitetoad.ru/ + ssh root@everytea.ru -- systemctl restart whitetoad + git stash pop +} + +cmd="$1" +[ -z "$cmd" ] || [ "$cmd" = "-h" ] || [ "$cmd" = "--help" ] && usage && exit 1 +shift +"$cmd" "$@" |
