]> git.armaanb.net Git - bin.git/commitdiff
add web-update-server to repo
authorArmaan Bhojwani <code@armaanb.net>
Fri, 18 Dec 2020 16:37:06 +0000 (11:37 -0500)
committerArmaan Bhojwani <code@armaanb.net>
Fri, 18 Dec 2020 16:37:06 +0000 (11:37 -0500)
web-update-server [new file with mode: 0755]

diff --git a/web-update-server b/web-update-server
new file mode 100755 (executable)
index 0000000..1a0f397
--- /dev/null
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+# Executed over ssh on sr.ht CI/CD for my websites
+
+gitrun() {
+  git -C $dir reset --hard
+  git -C $dir clean -fxd
+  git -C $dir pull --ff-only
+}
+
+if [[ $1 == "gemini" ]]; then
+  dir=/var/www/armaanb.net-gemini
+  gitrun
+  (cd /var/www/armaanb.net-gemini ; python3 mdconvert.py)
+elif [[ $1 == "gopher" ]]; then
+  dir=/var/www/armaanb.net-gopher
+  gitrun
+elif [[ $1 == "fortune" ]]; then
+  dir=/var/www/fortune-online
+  gitrun
+elif [[ $1 == "http" ]]; then
+  dir=/var/www/armaanb.net-http
+  gitrun
+  (cd /var/www/armaanb.net-http ; bash rss-gen)
+fi