git.post-receive 360 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. unset GIT_DIR
  3. cd /srv/git
  4. [ -e "build" ] || git clone blog.git build >/dev/null
  5. cd /srv/git/build
  6. echo "Updating build repo..."
  7. git pull -f /srv/git/blog.git >/dev/null
  8. git checkout -f >/dev/null
  9. echo "Building pelican..."
  10. DEBUG=1 make publish
  11. [ -e output ] && rm -rf /srv/www
  12. [ -e output ] && cp -al output/ /srv/www