Source files of publiccode.eu, the official website for the "Public Money, Public Code" campaign https://publiccode.eu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.sh 947B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.."
  3. cd "$basedir"
  4. mode=$1
  5. # Execute hugo buildrun
  6. if [ "$mode" == "server" ]; then
  7. hugo server
  8. elif [ "$mode" == "syntax" ]; then
  9. hugo
  10. else
  11. status=1
  12. tries=0
  13. while [[ $status -ne 0 ]]; do
  14. hugo
  15. status=$?
  16. (( tries++ ))
  17. if [[ $status != 0 && $tries -le 2 ]]; then
  18. echo "Build error with exit status $status on try $tries. Try again now"
  19. elif [[ $status != 0 && $tries -gt 2 ]]; then
  20. echo "Build failed 3 times in a row. Don't try again."
  21. exit 1
  22. fi
  23. done
  24. ## After successfully building the website, we set the AWS credentials and upload
  25. ## everything to our AWS s3 bucket.
  26. ##
  27. #if [ -f /srv/cred/aws.sh ]; then
  28. # . /srv/cred/aws.sh
  29. # /usr/local/bin/aws configure set default.s3.max_concurrent_requests 2
  30. # /usr/local/bin/aws s3 cp /usr/share/blog/public/ s3://aws-website-pmpc-soegm/ --recursive
  31. #fi
  32. fi