首页 > 代码库 > svn 钩子脚本
svn 钩子脚本
#vim post-commit
#!/bin/bash REPOS="$1" REV="$2" SVNLOOK="/usr/bin/svnlook" echo "`date +%F`" >> /tmp/post.log echo "REPOS=$1 REV=$2" >> /tmp/post.log echo -e "\$@=$@#" >> /tmp/post.log echo -e "`date +%F` end\n" >> /tmp/post.log $SVNLOOK changed "$REPOS" >> /tmp/list.txt project=`tail -n 1 /tmp/list.txt|awk ‘{print $2}‘|cut -d/ -f1-2` echo "$project" >>/tmp/p curl "http://center.sky.com/project/file_interface.php?svnupdate=2&pname=$project&dir=&file=&revision=" #curl "http://center.sky.com/project/file_interface.php?pname=$project&dir=&ufile="
#vim pre-commit
SVNLOOK=/usr/bin/svnlook REPOS="$1" TXN="$2" SCMLIST="superadmin,richard.wu" C_USER=`$SVNLOOK info -t $TXN $REPOS|sed -n "1p"`; if [ -z `echo $SCMLIST|grep $C_USER` ] then echo `$SVNLOOK changed -t $TXN $REPOS ` > /dev/shm/commit_log rm -rf /dev/shm/commit_log fi LOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" | wc -c` if ! $SVNLOOK log -t "$TXN" "$REPOS" |grep -P -i "v\d\.\d+_?(\d*)"; then echo -e "please input product version:\n eg:v2.203_20130802\n eg:v0.007_20130907\n" 1>&2 #echo -e "please input product version\n"; exit 1; fi exit 0
本文出自 “秋风颂” 博客,请务必保留此出处http://qiufengsong.blog.51cto.com/7520243/1429897
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。