Case Study of building a multi-version repository svn server using Centos

Source: Internet
Author: User
Tags mkdir sin svn svn update centos

Create a version Library folder

# Mkdir-p/data/svn/sinsvn
Create a version Library
# Svnadmin create/data/svn/sinsvn
# Mkdir-p/data/www/sinsvn
Import the project to the version library repository.
# Svn import/data/www/sinsvn/file: // data/svn/sinsvn-m "svn first test"
Check whether the import is successful
# Svn list-verbose file: // data/svn/sinsvn
Modify the configuration file of the version Library
# Vim/data/svn/sinsvn/conf/svnserve. conf

[General]
Anon-access = none
Auth-access = write
Password-db = ../passwd
Authz-db =.../../authz
Realm = sinsvn

Cp/data/svn/sinsvn/conf/passwd/data/svn
Cp/data/svn/sinsvn/conf/authz/data/svn

Modify the user files allowed to access the version Library

# Vim/data/svn/passwd
[Users]
Harry = harryssecret
Sin = sinssecret
Surpersin = surpersin

# Vim/data/svn/authz
[Groups]
Myteam = harry, sin

[/]
Surpersin = rw

[Sinsvn:/]
@ Myteam = rw

[Secsvn:/www]
@ Myteam = r
Sin = rw

[Sincms:/]
Sin = rw
Harry =
Start svn service
# Svnserve-d-r/data/svn/

Now, the version Library sinsvn can be used.
There are several solutions for multiple projects:
1. Start multiple svn services. Each SVN listens to different IP addresses or ports.
# Svnserve-d-listen-port 3690-r/data/svn1
# Svnserve-d-listen-port 3691-r/data/svn2

2. In a version library, you can divide directories by project and control the permissions of directories of various projects in authz.
[Sinsvn:/pro1]
Sin = rw
[Sinsvn:/pro2]
@ Myteam = rw

3. the SVN service listens to the root directory/data/svn of the version library, and then creates multiple version libraries under/data/svn. In the configuration files of each version Library, you can specify the user and permission file to the file in the root directory to manage them in a centralized manner. The above example already follows this practice.
# Svnserve-d-r/data/svn/

Svn automatic update hook:


# Cd/data/svn/sinsvn/hooks
# Cp post-commit.tmpl (post-commit)
# Vim post-commit

Export LANG = zh_CN.utf-8
REPOS = "$1 & Prime;
REV = "$2 & Prime;
SVN =/usr/bin/svn
WEB =/data/website/shebao/
LOG =/data/svn/logs/shebao. log
$ SVN update $ WEB-username ruesin-password ruesin
If [$? = 0]
Then
Echo "$ REPOS" "$ REV"> $ LOG
Echo 'date'> $ LOG
Echo "####################"> $ LOG
Fi

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.