Flexible Lisp Blogware. Fork for personal use. Mirrored from https://github.com/kingcons/coleslaw originally.

example.post-receive 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. ########## CONFIGURATION VALUES ##########
  2. # TMP_GIT_CLONE _must_ match the :repo argument in your .coleslawrc!
  3. TMP_GIT_CLONE=$HOME/tmp/improvedmeans/
  4. # Set LISP to your preferred implementation. The following
  5. # implementations are currently supported:
  6. # * sbcl
  7. # * ccl
  8. LISP=sbcl
  9. ########## DON'T EDIT ANYTHING BELOW THIS LINE ##########
  10. if cd `dirname "$0"`/..; then
  11. GIT_REPO=`pwd`
  12. cd $OLDPWD || exit 1
  13. else
  14. exit 1
  15. fi
  16. git clone $GIT_REPO $TMP_GIT_CLONE || exit 1
  17. while read oldrev newrev refname; do
  18. if [ $refname = "refs/heads/master" ]; then
  19. echo -e "\n Master updated. Running coleslaw...\n"
  20. if [ $LISP = sbcl ]; then
  21. sbcl --eval "(ql:quickload 'coleslaw)" \
  22. --eval "(coleslaw:main \"$TMP_GIT_CLONE\" \"$oldrev\")" \
  23. --eval "(coleslaw::exit)"
  24. elif [ $LISP = ccl ]; then
  25. ccl -e "(ql:quickload 'coleslaw) (coleslaw:main \"$TMP_GIT_CLONE\" \"$oldrev\") (coleslaw::exit)"
  26. else
  27. exit 1
  28. fi
  29. fi
  30. done
  31. rm -rf $TMP_GIT_CLONE
  32. exit