]> git.armaanb.net Git - bin.git/blob - web-update-server
Web-update-server: fix git pull command, set -e
[bin.git] / web-update-server
1 #!/usr/bin/env bash
2 # Executed over SSH on builds.sr.ht for my websites
3
4 set -e
5
6 gitrun() {
7   git -C $dir reset --hard
8   git -C $dir clean -fxd
9   git -C $dir pull origin main --ff-only 
10 }
11
12 if [[ $1 == "gemini" ]]; then
13   dir=/var/www/armaanb.net-gemini
14   gitrun
15   (cd /var/www/armaanb.net-gemini ; bash bin/web-gen)
16 elif [[ $1 == "gopher" ]]; then
17   dir=/var/www/armaanb.net-gopher
18   gitrun
19 elif [[ $1 == "fortune" ]]; then
20   dir=/var/www/fortune-online
21   gitrun
22 elif [[ $1 == "http" ]]; then
23   dir=/var/www/armaanb.net-http
24   gitrun
25   (cd /var/www/armaanb.net-http ; bash bin/web-gen)
26 fi