1、在web目录中checkout版本库
svn checkout svn://115.29.212.89(IP)/repository(SVN库名)
2、进入/home/svn/repository/hooks下,建立post-commit文件:
touch post-commit
给post-commit 执行权限:
chmod 755 post-commit vim post-commit
//在该文件里添加如下代码,保存
REPOS="$1" REV="$2" export.UTF-8 SVN_PATH=/usr/local/svn/bin (svn安装目录) WEB_PATH=/usr/local/apache/htdocs/ecshop (项目的根目录) SVN_USER=www (SVN服务器的账户名) SVN_PASS=hujiakeji2018 (密码) LOG_PATH=/tmp/svn.log echo `date "+%Y-%m-%d %H:%M:%S"` >> $LOG_PATH echo `whoami`,$REPOS,$REV >> $LOG_PATH $SVN_PATH/svn update $WEB_PATH --username $SVN_USER --password $SVN_PASS --no-auth-cache >> $LOG_PATH exit 0
OK 搞定!!!
林外听秋风