diff --git a/Config/HugoExample/files/cronjob.sh b/Config/HugoExample/files/cronjob.sh index aad61a9..1560710 100644 --- a/Config/HugoExample/files/cronjob.sh +++ b/Config/HugoExample/files/cronjob.sh @@ -6,6 +6,8 @@ FORCE="$1" BASEURL="$2" echo "*** Running cronjob @ `date` ***" +echo "FORCE=$FORCE" +echo "BASEURL=$BASEURL" # Pull any updates, and if the project is already up to date, exit successfully. git pull | grep -v "up to date" @@ -17,7 +19,9 @@ if [[ $status != 0 && -e /var/www/html/index.html && -z $FORCE ]]; then fi # If the project was not already up to date, build the new files for NGINX. +set -x /usr/local/bin/hugo $BASEURL --gc --minify +set +x status="$?" echo "* Hugo status is '$status', FORCE is '$FORCE'." if [[ $status == 0 && -e public/index.html ]]; then diff --git a/Config/HugoExample/files/main.sh b/Config/HugoExample/files/main.sh index 7ac34d3..61988f0 100644 --- a/Config/HugoExample/files/main.sh +++ b/Config/HugoExample/files/main.sh @@ -80,7 +80,9 @@ if [[ "$DEV" == "Y"* || "$DEV" == "T"* ]]; then echo "* Dev server not detected, starting..." cd $SITE killall hugo 2>/dev/null + set -x sudo -u www-data hugo server $baseurl -D -F --noBuildLock --bind 0.0.0.0 -p 1380 & + set +x fi sleep 30 done &