In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Single warehouse version, please go to http://cswllz.blog.51cto.com/2746613/1933598 by plane.
Before I talk about the operation, I would like to talk about my environment. The server uses centos7.3 and the server uses BT (pagoda system). It is faster for operating files. We do not have to type commands by ourselves. What we want is efficiency. The editor uses Sublime text3.
What we want to talk about here is the multi-warehouse version, which is basically similar to the single-warehouse version, but the difference lies in the processing of authz and passwd files.
Because the number of multiple warehouses is 2 or more, in order to facilitate the management of permissions, user names and passwords, the structure is as follows
/ var/svn # this is the root directory of svn / var/svn/project1 # this is the warehouse 1/var/svn/project2 # this is warehouse 2
That's the point.
1. Copy the authz and passwd under the conf folder under project1 to the svn root directory (/ var/svn), so that authz, passwd, project1 and project2 belong to the same level directory.
2. Open authz with Sublime text3 (the following is the content)
[groups] # svngroup is a user group, and laowei is a user svngroup = laowei,laowei2# "=". There must be a space [laowei:/] # indicating that the svngroup group has read and write permissions to the laowei domain in the root directory. R is read, w is write @ svngroup = rw.
After the above operation, you can save the authz
3. Open passwd with Sublime text3 (the following is the content)
[users] laowei = 123456laowei2 = 123456
4. Open the svnserve.conf under / var/svn/project1/conf and / var/svn/project2/conf with Sublime text3, and add the following
[general] # Control the permissions of non-authenticated users to access the version library anon-access = none# control the permissions of authenticated users to access the version library auth-access = write# specify the user name password file name password-db =.. /.. / passwd# specify the permissions configuration file name authz-db =.. /.. / authz# specify the authentication domain of the version library, that is, the authentication domain name prompted at login is realm = laowei#, which corresponds to [laowei:/] in the second point.
-after the above treatment, the environment is really OK.
When our local environment svn up to the warehouse, want to update the warehouse at the same time, the test site is also updated at the same time, how to do? We need to use a hook here. Don't be afraid because you don't know what a hook is. Just follow the instructions below.
The first step is to create a hook. Take project1 as an example. Under / var/svn/lw_taoke/hooks, create a new file named post-commit. Note that this file has no extension and is very convenient to build under the pagoda system. Copy the following code into it.
#! / bin/sh REPOS= "$1" # path to the warehouse REV= "$2" # newly submitted version number LOGFILE=/var/log/svn_lw_taoke.log # Log of the hook script # the standard output and standard error output of the script are printed to the log file exec 1 > > "$LOGFILE" exec 2 > & 1 SVNLOOK=/usr/bin/svnlookTIME=$ (date "+% Y) -% AUTHOR=$% d% H:%M:%S ") AUTHOR=$ ($SVNLOOK author-r $REV" $REPOS ") # submission author CHANGEDDIRS=$ ($SVNLOOK dirs-changed $REPOS) # modified directory collection MESSAGE=$ ($SVNLOOK log-r $REV" $REPOS ") # remarks at the time of submission Chinese # SVN client configuration is not recommended Need to modify * * CLIENT1=10.14.213.21 # project1 server # CLIENT2=172.16.4.236 # project2 server CLIENTSVNROOT=/www/wwwroot/we.chenshangwei.com # WEB server code root directory SVNUSER= "lw_taoke" SVNPASSWD= "Baihdgvcsw351" # * * * function myecho () {echo "$TIME"$*"} myecho "* * * "myecho" submitted version: $REV author: $AUTHOR "myecho" submission remarks: $MESSAGE "myecho" modified directory: $(echo $CHANGEDDIRS | tr'\ n'') "MASTERDIR=$ (echo" $CHANGEDDIRS "| head-1) # the highest level directory in CHANGEDDIRS # traverses the submitted code directory Synchronize to while on the WEB server ["$CHANGEDDIRS"! = ""] Do PROJECT=$ (echo $MASTERDIR | awk-F /'{print $1}') # determine the project folder myecho myecho "Project: $PROJECT synchronization directory: $MASTERDIR" myecho "synchronization $MASTERDIR to $CLIENT1:$CLIENTSVNROOT/$MASTERDIR" # password-less ssh connects to the client server and executes svn up export LANG=en_US.UTF-8 Sudo-u www svn up-- non-interactive-- username $SVNUSER-- password $SVNPASSWD "$CLIENTSVNROOT" / lw_taoke # svn up-- non-interactive-- username $SVNUSER-- password $SVNPASSWD "$CLIENTSVNROOT" / lw_taoke # Delete the subdirectory CHANGEDDIRS=$ (echo "$CHANGEDDIRS" | grep-v "^ $MASTERDIR") # from the directory collection to get a new top-level directory MASTERDIR=$ (echo "$CHANGEDDIRS" | head-1) done that needs synchronization
The second step is to change to the root directory of the test website and type the following command, which means to pick up the code in the repository and change the owner of project1 to www
Sudo-u www svn co svn://10.14.213.219/lw_test / www/wwwroot/project1
The third step is to operate the pick-up function on your local website, and then under the picked-up directory, you can create a new file or folder, and submit updates will synchronize the file or folder to the test site. Is it very convenient?
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.