SVN 多项目配置 (shell 一键配置)
2015-11-11 15:17
435 查看
SVN仓库配置
在SVN仓库目录中新建一个配置文件夹Configmkdir ./Config
里面可以复制利用下面命令创建的仓库配置
svnadmin create repository cp ./repository/conf/authz ./Config/authz cp ./repository/conf/passwd ./Config/passwd cp ./repository/conf/svnserve.conf ./Config/svnserve.conf
操作结果
然后对这三个文件进行配置
这里我先配置一个叫repository的svn仓库例子
authz文件配置如下:
[aliases] # joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average [groups] # harry_and_sally = harry,sally # harry_sally_and_joe = harry,sally,&joe [repository:/] repository = rw
passwd文件配置如下:
[users] repository = 123456
svnserve.conf文件配置如下:
[general] anon-access = none auth-access = write ### 两行代码要注意看路径,你们的svn仓库也许不是/home/svnService password-db = /home/svnService/Config/passwd authz-db = /home/svnService/Config/authz # groups-db = groups realm = example # force-username-case = none # hooks-env = hooks-env [sasl] # use-sasl = true # min-encryption = 0 # max-encryption = 256
到这一步可以把Config中的svnserve.conf文件复制回./repository/conf文件夹里面
然后把realm = example 改成 realm = repository
在命令行运行svnserve -d -r /home/svnService即可完成一个版本库的配置
在客户端可以使用tortoisesvn进行checkout操作了,输入用户repository和密码123456 就能checkout完成
但我的目的不是到这步结束,把上面说的authz、passwd 和svnserve.conf是有目的性的
authz 文件对SVN仓库的所有权限和访问路径进行配置
passwd 文件对所有SVN仓库的密码进行设置
svnserve.conf 这个文件只是一个模板,供新增的仓库使用
svn一键创建仓库脚本
编辑一个sh文件,放到版本库的根目录,文件名为setup.sh#!/bin/bash echo -n "Please input the svn repository name:" read name echo -n "Please input the svn username:" read user echo -n "Please input the svn password:" read password if [ -d $name ] then echo "Directory is exist!" else svnadmin create $name rm -rf ./${name}/conf/* cp ./Config/svnserve.conf ./${name}/conf/ sed -i "s/realm = example/realm = ${name}/" ./${name}/conf/svnserve.conf echo "${user} = ${password}" >> ./Config/passwd echo -e "[${name}:/]\n${user} = rw" >> ./Config/authz killall svnserve # 这里的svn仓库要改成你自己的svn仓库绝对路径 svnserve -d -r /home/svnService fi
使用:
# bash ./setup.sh Please input the svn repository name:kkk Please input the svn repository username:ddd Please input the svn repository password:123456
版本创建好了,直接在客户机上checkout即可(注意输入对应的用户密码,不能搞混了)
相关文章推荐
- shell点滴
- linux shell 中文件编码查看及转换方法
- cpu压力测试(c + shell)
- shell date处理
- shell中的${},##, %% , :- ,:+, ? 的使用
- 学习笔记之Shell脚本的输出重定向
- gitlab一键安装+内网
- 关于content_shell的单进程模式bug
- Linux系统防CC攻击自动拉黑IP增强版Shell脚本 《Linux系统防CC攻击自动拉黑IP增强版Shell脚本》来自张戈博客
- 韩顺平Linux笔记(八)——Shell介绍
- linux下的expr命令(shell的算数运算问题)
- 让shell脚本中的echo输出带颜色
- MFG总结(8) -- ShellExecute与ShellExecuteEx的用法
- shell命令合集
- .bash_profile和.bashrc的什么区别
- linux环境: shell初始化文件, for TCSH, CSH
- Linux Shell学习要点
- Linux中shell自动交互的使用
- linux shell 编程 9 脚本中调用脚本
- linux shell变量