相关文章:
http://vps.lijialong.name/install-svn.html
http://vps.lijialong.name/install-subversion.html
http://vps.lijialong.name/awk.html
一个完整的post-commit文件内容:
#!/bin/sh REPO="$1" #REV="$2" export LANG=zh_CN.UTF-8 CURDATE=`date` webdata=/var/www/html/svntest echo "Code Deployed By at $CURDATE" >> /opt/svnrespo/postcommit.log #执行更新 /opt/subversion/bin/svn update $webdata --username xiaobai --password 111111 --no-auth-cache >> /opt/svnrespo/postcommit.log #获取更新的文件,然后对其做相应操作 /opt/subversion/bin/svnlook changed $REPO | awk '{ if($1=="A" || $1=="U") { system("chown ftpuser:apache /var/www/html/svntest/"$2""); system("chmod 775 /var/www/html/svntest/"$2""); }}' #A 已添加 #D 已删除 #U 已更新 #C 合并冲突 #G 合并成功 #E 已存在 #R 已替换
短短几行代码花了我一天时间!