summaryrefslogtreecommitdiff
path: root/run.sh
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2024-11-06 18:06:17 +0600
committerunwox <me@unwox.com>2024-11-06 18:06:17 +0600
commitc69f561ccde0ad85bfec3321e3cac4a31aabc0af (patch)
tree0813eb4dc10543de638f2919cf778975f41b419a /run.sh
parentd7a811e4fa87866dad41dc871d0484739df16dbc (diff)
add deploy script
Diffstat (limited to 'run.sh')
-rwxr-xr-xrun.sh17
1 files changed, 16 insertions, 1 deletions
diff --git a/run.sh b/run.sh
index 525cf97..64ec362 100755
--- a/run.sh
+++ b/run.sh
@@ -4,7 +4,8 @@ set -e
usage () {
echo "Usage:
serve [--jit] Serve the site pages
- fetch [--jit] Populate the database with records"
+ fetch [--jit] Populate the database with records
+ deploy Deploy changes to the production server"
}
serve () {
@@ -29,6 +30,20 @@ fetch () {
fi
}
+deploy () {
+ git stash -u
+ scp bin/* root@everytea.ru:~/everytea.ru/bin/
+ scp parser/* root@everytea.ru:~/everytea.ru/parser/
+ scp lib/* root@everytea.ru:~/everytea.ru/lib/
+ scp static/* root@everytea.ru:~/everytea.ru/static/
+ scp texts.fnl root@everytea.ru:~/everytea.ru/
+ scp fetcher.fnl root@everytea.ru:~/everytea.ru/
+ scp main.lua root@everytea.ru:~/everytea.ru/
+ ssh root@everytea.ru -- systemctl restart everytea
+ ssh root@everytea.ru -- 'echo "DELETE FROM cache WHERE key like '\''page:%'\''" | sqlite3 ~/everytea.ru/var/db.sqlite'
+ git stash pop
+}
+
cmd="$1"
[ -z "$cmd" ] || [ "$cmd" = "-h" ] || [ "$cmd" = "--help" ] && usage && exit 1
shift