diff options
| -rw-r--r-- | Makefile | 7 | ||||
| -rwxr-xr-x | error.sh | 7 | ||||
| -rw-r--r-- | gospeladlershof.de/Makefile | 8 | ||||
| -rwxr-xr-x | gospeladlershof.de/build.sh (renamed from gospeladlershof.de/deploy,sh) | 2 | ||||
| -rw-r--r-- | gospeladlershof.de/static/robots.txt | 4 | ||||
| -rw-r--r-- | log/.gitkeep | 0 |
6 files changed, 20 insertions, 8 deletions
@@ -4,9 +4,10 @@ build: cd gospeladlershof.de && make build deploy: - @if [ -d /var/www/gospeladlershof.de ]; then\ - rsync --delete --exclude=secrets.php --exclude=json -avz intern/ /var/www/gospeladlershof.de/intern/ && \ - cd gospeladlershof.de && rsync --delete -avz public/ /var/www/gospeladlershof.de/gospeladlershof.de/; \ + if [ -d /var/www/gospeladlershof.de ]; then\ + ( rsync --delete --exclude=secrets.php --exclude=json -avz intern/ /var/www/gospeladlershof.de/intern/ 1>/dev/null 2>/dev/null && \ + cd gospeladlershof.de && rsync --delete -avz public/ /var/www/gospeladlershof.de/gospeladlershof.de/ 1>/dev/null 2>/dev/null && \ + echo "Success: Site gospeladlershof.de was built.") || ./error.sh; \ else \ echo rsync --delete -avze ssh intern/ online:/var/www/gospeladlershof.de/intern/ && \ cd gospeladlershof.de && rsync --delete --exclude=secrets.php --exclude=json -avze ssh public/ online:/var/www/gospeladlershof.de/gospeladlershof.de/; \ diff --git a/error.sh b/error.sh new file mode 100755 index 0000000..4d1397d --- /dev/null +++ b/error.sh @@ -0,0 +1,7 @@ +#!/bin/bash +msg="Failure: Could not built site gospeladlershof.de." +attach=$(cat log/hugo.log) + +echo "$msg" +echo "" +echo "$attach" diff --git a/gospeladlershof.de/Makefile b/gospeladlershof.de/Makefile index c04159a..85c70fc 100644 --- a/gospeladlershof.de/Makefile +++ b/gospeladlershof.de/Makefile @@ -1,7 +1,7 @@ all: build build: - @./deploy,sh + @./build.sh serve: server @@ -9,4 +9,8 @@ server: hugo server deploy: - rsync --delete -avze ssh public/ online:/var/www/gospeladlershof.de/gospeladlershof.de/ + @if [ -d "/var/www/gospeladlershof.de/gospeladlershof.de/" ]; then \ + rsync --delete -avz public/ /var/www/gospeladlershof.de/gospeladlershof.de/; \ + else \ + rsync --delete -avze ssh public/ online:/var/www/gospeladlershof.de/gospeladlershof.de/; \ + fi diff --git a/gospeladlershof.de/deploy,sh b/gospeladlershof.de/build.sh index 7a5bf70..a98ab9b 100755 --- a/gospeladlershof.de/deploy,sh +++ b/gospeladlershof.de/build.sh @@ -5,7 +5,7 @@ export DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) if [ ! -z $DIR ]; then cd $DIR && \ rm -rf $DIR/public && \ - hugo --ignoreCache + hugo --ignoreCache --log=true --logFile=../log/hugo.log --verbose=false 1>/dev/null else echo "Kann nicht den aktuellen Pfad ermitteln!" 1>&2 exit 1 diff --git a/gospeladlershof.de/static/robots.txt b/gospeladlershof.de/static/robots.txt index 7ef09c1..1d6c2b2 100644 --- a/gospeladlershof.de/static/robots.txt +++ b/gospeladlershof.de/static/robots.txt @@ -2,13 +2,13 @@ # A robot must obey the orders given it by human beings, except where such orders would conflict with the First Law # A robot must protect its own existence, as long as such protection does not conflict with the First or Second Laws. # -# Order is important! https://xkcd.com/1613/ +# The order is important! https://xkcd.com/1613/ User-agent: * Disallow: /termine.json Disallow: /termine.lua Disallow: /api/ -Allow: * +Allow: / User-agent: nsa Disallow: / diff --git a/log/.gitkeep b/log/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/log/.gitkeep |
