publish-doxygen 997 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash -e
  2. # thanks to http://blog.gockelhut.com/2014/09/automatic-documentation-publishing-with.html
  3. # Settings
  4. REPO_PATH=https://github.com/MetaluNet/Fraise-doc.git
  5. HTML_PATH=html
  6. COMMIT_USER="Documentation Builder"
  7. COMMIT_EMAIL="_antoine_@metalu.net"
  8. CHANGESET=$(git rev-parse --verify HEAD)
  9. # Get a clean version of the HTML documentation repo.
  10. rm -rf ${HTML_PATH}
  11. mkdir -p ${HTML_PATH}
  12. git clone -b gh-pages "${REPO_PATH}" ${HTML_PATH}
  13. # rm all the files through git to prevent stale files.
  14. cd ${HTML_PATH}
  15. if [ `git config remote.origin.url` != ${REPO_PATH} ] ; then cd -; echo "ERROR cloning ${REPO_PATH} !" ;exit ; fi
  16. git rm -rf .
  17. cd -
  18. # Generate the HTML documentation.
  19. doxygen
  20. # Create and commit the documentation repo.
  21. cd ${HTML_PATH}
  22. git add .
  23. git config user.name "${COMMIT_USER}"
  24. git config user.email "${COMMIT_EMAIL}"
  25. git commit -m "Automated documentation build for changeset ${CHANGESET}."
  26. echo Pushing to `git config remote.origin.url`
  27. git push origin gh-pages
  28. cd -