1、重中之重:第一次更新需要先把数据库先检索出来,执行脚本./post.commit
#!/bin/sh
export LANG=en_US.UTF-8
SVN=/usr/local/subversion/bin/svn
WEB=/www
$SVN checkout
$WEB
2、修改权限:
chown -R daemon.daemon /www
chmod -R 777 /www
chown -R daemon.daemon
/usr/local/subversion/repos/web/hooks/post-commit
chmod -R 777
/usr/local/subversion/repos/web/hooks/post-commit
3、在库文件的hooks下新建post-commit文件。在post-commit文件里添加
REPOS="$1"
REV="$2"
SVN=/usr/bin/svn
WWW=/home/web/htdocs/dev
export LANG="zh_CN.UTF-8"
$SVN update --username snow --password snowpwd $WWW