Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Linux CentOS configuration SVN + SVN hook     - Hibernate + JUnit test entity class generate database table (Programming)

- PHP 7.0 Upgrade Notes (Linux)

- Atheros AR8161 / AR8162 network card driver problem solving in CentOS 6.4 (Linux)

- Nginx Beginner Guide (Server)

- Handle large data problems Bit-map method (Programming)

- CentOS installed JDK8 (Linux)

- Change CentOS 7 NIC name eno16777736 to eth0 (Linux)

- BCP importing and exporting large amounts of data Practice (Database)

- Setting Wetty do not need an account login command line operations (Linux)

- Zabbix monitoring Oracle Database use Orabbix plug (Enhanced Edition) (Database)

- RHEL 7.1 compile and install Ganglia 3.7.1 (Server)

- JavaScript basic types and type conversion (Programming)

- TPCC-MySQL Benchmark (Database)

- OpenGL Superb Learning Notes - Fragment Shader (Programming)

- HAProxy performance under high concurrency (Server)

- Using nmcli commands to manage network in RedHat / CentOS 7.x (Linux)

- Open container cluster management system architecture and components introduced Kubernetes (Server)

- Linux environment installation of rvm and ruby (Linux)

- iptables using summary (Linux)

- Search Linux commands and files - which, whereis, locate, find (Linux)

 
         
  Linux CentOS configuration SVN + SVN hook
     
  Add Date : 2017-08-31      
         
       
         
  Environment Introduction:
Operating System: CentOS release 6.5 (Final) 64-bit
Network environment: Intranet

1 Configure the SVN
1.1 Install the SVN package
Use yum to install the required packages for svn
# Yum -y install subversion

1.2 Configuring the SVN
1.2.1 Create the svn library path
Create the svn library path, which provides later user file writes and reads.
# Mkdir -p / date / svn /

1.2.2 Create an SVN repository
Use a specific command to create the repository, and after the creation of the directory, the SVN configuration file will appear.
# Svnadmin create / date / svn /

1.2.3 Define the configuration file
#vim /opt/svndata/repos1/conf/svnserve.conf

[General]
Anon-access = none
Auth-access = write
Password-db = passwd # Define the configuration file for the user password
Authz-db = authz # Define the user rights profile
Realm = svn

1.2.4 User Rights Configuration
1, the creation of svn visit users
# Vim / data / svn / passwd

[Users]
Test = test Creates a user named tset with the password test

2, the allocation of user access
#vi / opt / svndata / repos1 / conf / authz

[Groups]
Admin = test
# Harry_and_sally = harry, sally
[/]
@admin = rw
[Repos1: / abc / aaa]
@admin = r

Repository directory format:
[< Repository>: / project / directory] # is the project name as the first unit. Imagine the project as a unit
@ < User group name> = < permission>
< User name> = < permission>
Among them, the box can be a number of parts of the wording:
/, Indicates the root directory and the following. The root directory is specified at svnserve startup, and we specify / opt / svndata. In this case, / means to set permissions on all repositories.
Repos1: /, said the authority to set up a repository
Repos2: / abc,, said that the repository 2 abc project set permissions
Repos2: / abc / aaa,, said the abc in the repository 2 projects aaa directory set permissions
The authority principal can be a user group, a user, or a user group, and the user group is preceded by @ and * for all users. Permissions can be w, r, wr and empty, empty means that there is no authority.
1.2.5 Starting the SVN
# Svnserve -d -r / date / svn /

-d means running in daemon mode (running in background)
-r / date / svn Specifies that the root directory is / date / svn
1.3 Configuring the Hook
1.3.1 Configuring the Version Detection Tool
Their use of python to write a document automatically detects the version of the tools inside the library. The code is as follows:
# Vim /date/svn/hooks/gouzi.py
#! / Usr / bin / env python
If __name __ == '__ main__':
  Importsys, string
  Try:
    Logfile = open ( '/ tmp / python.out', 'a +')
  Logfile.write ( "this is python hook")
  Logfile.close ()
  Except:
    Exit (1)
  Sys.exit (0)

This tool must be placed in the hooks directory in the library directory.
1.3.2 Configuring the UPDATE Script
1, the first manual checkout on the client
# Svn checkout svn: //192.168.21.28/repos

2, edit the automatic synchronization script
# Vim svn_update.sh

The code is as follows
 #! / Bin / bash
/ Usr / bin / svn update / linshi / repos --username test --password test
If [$? == 0]
  Then
        Echo "ok" >> /tmp/z.out
Fi

Where: / linshi / for the storage directory (depending on the environment may be)
    --username test User name is test
    --password test The password is test
3, modify the permissions
# Chmod + x /root/svn_update.sh

4, configure the scheduled tasks
Because the script can not achieve automatic execution, so configure the scheduled task settings once per minute.
# Crontab -e
* * * * /root/svn_update.sh> / dev / null 2> & 1
     
         
       
         
  More:      
 
- Oracle Shared Server Configuration (Database)
- Shell script to delete empty folders recursively (Linux)
- C # function (Programming)
- Linux Getting Started tutorial: Borrow Windows fonts in Ubuntu 14.10 (Linux)
- Elaborate .NET Multithreading: Thread Pool (Programming)
- CentOS Linux firewall configuration and Close (Linux)
- Linux - use chroot command (Linux)
- How to use the on-screen keyboard in Linux (Linux)
- IIS virtual host of safety knowledge (Linux)
- Ubuntu 12.04 LTS installation configuration JDK1.6.0_45 (Linux)
- MySQL optimization resulting order by using filesort (Database)
- Configuring Eclipse Note Templates (Linux)
- Ubuntu Locale configuration problem solving Can not set LC_CTYPE (Linux)
- Binary tree to the next node (Programming)
- Install Java JDK 8 in CentOS 7 / 6.5 / 6.4 (Linux)
- Solve ORA-01012: not logged on (Database)
- How to implement large-scale distributed Yahoo depth study on the Hadoop cluster (Server)
- Open container cluster management system architecture and components introduced Kubernetes (Server)
- Linux security configuration (Linux)
- Build the first ASP.NET 5 Web project in Mac OS X Yosemite 10.10.3 (Server)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.