一.SVN安装
yum install subversion
二.SVN创建版本库
mkdir -p /opt/svn/repos
svnadmin create /opt/svn/repost
三.SVN修改配置(配置项之前不存在空格)
1.vi /opt/svn/repos/conf/authz
[/]
acong = rw
2. vi /opt/svn/repos/conf/passwd
[user]
acong = 123456
3. vi /opt/svn/repos/svnserve.conf
[general]
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
realm = /opt/svn/repos
二.SVN启动关闭
svnserve -d -r /opt/svn/repos
netstat -ln | grep 3690
ps -ax | grep svnserve
killall svnserve
kill -9 pid
三.测试账号
svn co http://192.168.129/dev
四.SVN导入初始代码
find . -type d -name ".svn"|xargs rm -rf
svn import /data/dev/ file:///opt/svn/repos/ -m "init information"
五.钩子自动部署
在web目录检出代码
vi /opt/svn/repos/hooks/post-commit
export LANG=zh_CN.UTF-8
SVN=/usr/bin/svn
WEB=/data/dev/
$SVN update $WEB --username uname --password password
原文地址:http://rhino.blog.51cto.com/5504750/1794421