We have an intermediate version of our web application (this is basically a working copy of subversive work that no one works on), which lives in '/ apps / software'. Each developer has their own working copy in "~ / apps / software". I would like to use a simple post-commit hook script to update an intermediate copy every time a developer commits a change to the repository.
Sounds just like that? Well, I already banged my head on a brick wall for a long time than I should. The script hook (called "post-commit" located in / svn / software / hooks, permissions = 777, user: group = apache: dev) looks like this (ignore the missing bits):
#!/bin/sh /usr/bin/svn update /apps/software >> /var/log/svn/software.log # REPOS="$1" # REV="$2" # AUTHOR=`/usr/bin/svnlook author -r "$REV" "$REPOS"` # LOG=`/usr/bin/svnlook log -r "$REV" "$REPOS"` # EMAIL=" test@example.com " # echo "Commit log message as follows:- # # \"${LOG}\" # # The staging version has automatically been updated. # # See http://trac/projects/software/changeset/${REV} for more details." | /bin/mail -s "SVN : software : revision ${REV} committed by ${AUTHOR}" ${EMAIL}
What is it. The log file has the same user and user permissions: group as the post-commit script, and I even gave the intermediate user the same user: group and permissions. Apache itself (we use the subversion apache extension) runs under apache: dev. I know that the frame is being executed because the material that commented above sending the email works fine - it's just an update command that is not.
I can also execute the post-commit script hook without environment variables using:
$ env - /svn/software/hooks/post-commit /svn/software <changeset>
and it works fine, doing "svn update" without any problems. I even tried removing the “→” in the log file, but that does not make any difference.
Any help on this would be greatly appreciated ...
source share