[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Post Commit Hook Script !!

From: Himanshu Raina <raina_himanshu_at_yahoo.com>
Date: Fri, 29 Jul 2011 12:47:14 +0530 (IST)

Hi,
The post-commit script isn't getting executed whenever code is merged from trunk to tags. Whenever the code needs to be deployed the code is copied from trunk to tags. The script runs fine when executed on the server but doesn't get invoked whenever a commit is done.
svn co http://mydomain.com/svn/Project/Trunk/Code http://mydomain.com/svn/Project/Tags/QA/Code_2424
I'm using capistrano for deploying code on my server. The post commit hook is given below
#!/bin/sh#############################################################################################REPOS="$1"
DIR=`/usr/bin/svnlook changed  $REPOS | /usr/bin/head -n1 | /bin/cut -d'/' -f2`
Method=`/usr/bin/svnlook changed  $REPOS | /usr/bin/head -n1 | /bin/awk '{print $1}'`
/bin/echo $REPOS $DIR $Method#################---Addition---#####################if [ "$Method" == "A" ] && [ "$DIR" == "QA" ]; then
TID=`/usr/bin/svnlook changed  $REPOS | /usr/bin/head -n1 | /bin/cut -d"/" -f3`
echo "Do you wish to deploy the code on QA server"read inputif [[ $input == '' ]]; thenecho "Usage: $0 <Y/N>"elif [ $input == Y ]; then/usr/bin/ssh user_at_172.16.3.2 "cd /newdeploy/Project/config ; /usr/bin/cap deploy:php tagid=$TID"elif [ $input == N ]; thenexitfi##############---Modification---################################elif [ "$Method" == "M" ] && [ "$DIR" == "QA" ]; then
TID=`/usr/bin/svnlook changed  $REPOS | /usr/bin/head -n1 | /bin/cut -d"/" -f3`
echo "Do you wish to deploy the code on QA server"read inputif [[ $input == '' ]]; thenecho "Usage: $0 <Y/N>"elif [ $input == Y ]; then/usr/bin/ssh  user_at_172.16.3.2 "cd /newdeploy/Project/config ; /usr/bin/cap deploy:php tagid=$TID"elif [ $input == N ]; thenexitfi################---Deletion##############################elif [ "$Method" == "D" ]; then
exit
fi######################################################

Regards,Himanshu
Received on 2011-07-29 09:18:22 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.