找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 9665|回复: 0

SVN LINUX

[复制链接]

295

主题

38

回帖

1267

积分

管理员

积分
1267
发表于 2021-6-16 12:59:43 | 显示全部楼层 |阅读模式
[root@VM-0-6-centos ~]# yum -y install subversion
[root@VM-0-6-centos ~]# mkdir -p /var/svn/cangku
[root@VM-0-6-centos ~]# svnadmin create /var/svn/cangku/
[root@VM-0-6-centos ~]# cd /var/svn/cangku/
[root@VM-0-6-centos cangku]# ls -a
.  ..  conf  db  format  hooks  locks  README.txt
[root@VM-0-6-centos cangku]# cd ./conf/
[root@VM-0-6-centos conf]# ls
authz  hooks-env.tmpl  passwd  svnserve.conf
[root@VM-0-6-centos conf]# vi authz
[root@VM-0-6-centos conf]# vi passwd
[root@VM-0-6-centos conf]# vi svnserve.conf
[root@VM-0-6-centos conf]# svnserve -dr /var/svn/cangku
[root@VM-0-6-centos conf]# pstree |grep svn
        |-svnserve
[root@VM-0-6-centos conf]# netstat -tunpl|grep svn
tcp        0      0 0.0.0.0:3690            0.0.0.0:*               LISTEN      502728/svnserve
[root@VM-0-6-centos conf]#

打开3690端口,目前我是在宝塔开的
以上SVN服务就安装完成了

设置 iptables 防火墙,把 3690端口打开
iptables -A INPUT -p tcp --dport 3690 -j ACCEPT

设置 svnserve 仓库程序在 linux 服务器重启后开机启动
vi /etc/rc.local
/usr/bin/svnserve -dr /var/svn/cangku
/usr/bin/svnserve -dr /var/svn/m --listen-port 3691
这里示例启动两个仓库两个端口,第一个默认3690

设置网站目录权限
setfacl -m u:www:rwx -R /www/wwwroot/kok.bet
setfacl -m d:u:www:rwx -R /www/wwwroot/kok.bet

测试网站检出
[root@VM-0-6-centos conf]# cd /www/wwwroot/kok.bet
[root@VM-0-6-centos kok.bet]# ls
[root@VM-0-6-centos kok.bet]# svn co svn://129.226.73.163 ./
Authentication realm: <svn://129.226.73.163:3690> /var/svn/cangku
Password for 'root': *********

Authentication realm: <svn://129.226.73.163:3690> /var/svn/cangku
Username: yds
Password for 'yds': ***


-----------------------------------------------------------------------
ATTENTION!  Your password for authentication realm:

   <svn://129.226.73.163:3690> /var/svn/cangku

can only be stored to disk unencrypted!  You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible.  See the documentation for details.

You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/root/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? yes
A    index.php
Checked out revision 1.
[root@VM-0-6-centos kok.bet]#


检出完成了

设置钩子
/var/svn/cangku/hooks
post-commit脚本

export LANG=en_US.UTF-8
svn up --non-interactive --username yds --password 123 '/www/wwwroot/kok.bet'
拷贝模板文件改成脚本就可以执行,我在宝塔新建一个不成功。

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|外汇论坛 ( 粤ICP备16021788号 )

GMT+8, 2024-5-4 22:18 , Processed in 0.090813 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表