From 6857f8e5061180aa530c2610fec8235acdfbb66a Mon Sep 17 00:00:00 2001 From: Horus Date: Thu, 3 Mar 2016 18:22:34 +0100 Subject: Fügt die Makefiles für die build pipeline hinzu. --- Makefile | 7 ++++--- error.sh | 7 +++++++ gospeladlershof.de/Makefile | 8 ++++++-- gospeladlershof.de/build.sh | 12 ++++++++++++ gospeladlershof.de/deploy,sh | 12 ------------ gospeladlershof.de/static/robots.txt | 4 ++-- log/.gitkeep | 0 7 files changed, 31 insertions(+), 19 deletions(-) create mode 100755 error.sh create mode 100755 gospeladlershof.de/build.sh delete mode 100755 gospeladlershof.de/deploy,sh create mode 100644 log/.gitkeep diff --git a/Makefile b/Makefile index 44c876b..0c6de7c 100644 --- a/Makefile +++ b/Makefile @@ -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/build.sh b/gospeladlershof.de/build.sh new file mode 100755 index 0000000..a98ab9b --- /dev/null +++ b/gospeladlershof.de/build.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +export PATH=$PATH:/usr/local/bin:/home/horus/bin +export DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +if [ ! -z $DIR ]; then + cd $DIR && \ + rm -rf $DIR/public && \ + 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 +fi diff --git a/gospeladlershof.de/deploy,sh b/gospeladlershof.de/deploy,sh deleted file mode 100755 index 7a5bf70..0000000 --- a/gospeladlershof.de/deploy,sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -export PATH=$PATH:/usr/local/bin:/home/horus/bin -export DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -if [ ! -z $DIR ]; then - cd $DIR && \ - rm -rf $DIR/public && \ - hugo --ignoreCache -else - echo "Kann nicht den aktuellen Pfad ermitteln!" 1>&2 - exit 1 -fi 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 -- cgit v1.2.3