hugo.sh 314 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. set -e
  3. if [ "$#" -ne 2 ]
  4. then
  5. echo "USAGE: $0 DOMAIN REPO"
  6. exit 1
  7. fi
  8. export WORKSPACE=/var/www/$1
  9. if [ ! -d $WORKSPACE/repo.git ]
  10. then
  11. git clone $2 $WORKSPACE/repo.git
  12. fi
  13. cd $WORKSPACE/repo.git
  14. git pull
  15. git submodule update --init --recursive
  16. hugo -d $WORKSPACE/htdocs
  17. echo "done."
  18. exit 0