local-svn-update 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. #Post Commit script for this project.
  3. # Important! the working copy in WWWREPOS must have been checked out by using a
  4. # file:/// form, not in the http:// form otherwise the svn
  5. # update will complain that it doesn't have the password for apache
  6. # Important! No user should update manually the working copy in WWWREPOS, nor
  7. # work directly on it. Or at least, be very careful to leave the resulting files
  8. # with ownership of apache.apache, otherwise, any subsequent update of those
  9. # file or files will result in error
  10. PATH=/bin:/usr/bin
  11. # $1 contains the path to the svn repository
  12. REPOS=`basename "$1"`
  13. # The version number
  14. REV="$2"
  15. #Path in remote host where the local copy is
  16. WWWREPOS="$3"
  17. #Email to send a report of this transaction. Can contain several address, comma separated
  18. MAILTO="$4"
  19. cd $WWWREPOS || exit 1;
  20. ( svn log -r $2 ;
  21. echo -e "\n\n";
  22. svn update ;
  23. if [[ -f /usr/local/bin/svn-post-commit/$REPOS ]]; then . /usr/local/bin/svn-post-commit/$REPOS $WWWREPOS; fi;
  24. if [[ -f .svn-post-commit ]]; then . .svn-post-commit; fi;
  25. ) 2>&1 | mail $MAILTO -s "[SVN $REPOS] Commit of revision $REV"