Merge branch 'more-robust-build' of max.mehl/pmpc-website into master

lektura
Max Mehl 2017-09-20 17:34:05 +02:00 committed by Gogs
commit a98cd34cae
1 changed files with 18 additions and 3 deletions

View File

@ -19,10 +19,25 @@ if [ "$mode" == "server" ]; then
elif [ "$mode" == "syntax" ]; then elif [ "$mode" == "syntax" ]; then
hugo hugo
else else
hugo status=1
tries=0
while [[ $status -ne 0 ]]; do
## hugo
## After building the website, we set the AWS credentials and uplodad status=$?
(( tries++ ))
if [[ $status != 0 && $tries -le 2 ]]; then
echo "Build error with exit status $status on try $tries. Try again now"
elif [[ $status != 0 && $tries -gt 2 ]]; then
echo "Build failed 3 times in a row. Don't try again."
exit 1
fi
done
## After successfully building the website, we set the AWS credentials and uplodad
## everything to our AWS s3 bucket. ## everything to our AWS s3 bucket.
## ##
#if [ -f /srv/cred/aws.sh ]; then #if [ -f /srv/cred/aws.sh ]; then