SVN Hook operation-Update web directory synchronously

Source: Internet
Author: User
Tags svn update

A simple hook Demo: You can also search the Internet for other advanced

This time to achieve the function is: each time the user commits to the warehouse, the warehouse hook will automatically put the program and update the www/Web publishing directory

1. Now create a test.com site directory under the web directory

[Email protected] ~]# cd/var/www/html/[email protected] html]# svn checkout svn://localhost/test.comAuthentication Realm: <SVN://localhost:3690> 59865037-2557-40be-aa97-d460f66b4c60Password for 'Root': Authentication Realm:<SVN://localhost:3690> 59865037-2557-40be-aa97-d460f66b4c60Username:wentaopassword for 'Wentao': -----------------------------------------------------------------------ATTENTION! Your Password forAuthentication Realm:<SVN://localhost:3690> 59865037-2557-40be-aa97-d460f66b4c60can only is stored to disk unencrypted!You is advised to Configureyour system so that Subversion can store passwords encrypted,ifpossible. See the documentation fordetails. You can avoid future appearances of this warning by setting the valueof the'Store-plaintext-passwords'Option to either'Yes'Or'No' inch'/root/.subversion/servers'.-----------------------------------------------------------------------Store Password unencrypted (yes/no)?YA test.com/2. Txta test.com/3. Txta test.com/TEST.PHPA test.com/1. phpchecked Out Revision8. [Email protected] html]#

Follow the prompts to enter the root password, and the SVN authorization username and password

Then configure the script for the Hook folder

[Email protected] hooks]#pwd/root/svnrepo/test.com/Hooks[[email protected] hooks]# lltotal $-rw-r--r--.1Root root1977Mar in  ,: -Post-Commit.tmpl-rw-r--r--.1Root root1638Mar in  ,: -Post-Lock.tmpl-rw-r--r--.1Root root2289Mar in  ,: -post-revprop-Change.tmpl-rw-r--r--.1Root root1567Mar in  ,: -Post-Unlock.tmpl-rw-r--r--.1Root root3426Mar in  ,: -Pre-Commit.tmpl-rw-r--r--.1Root root2434Mar in  ,: -Pre-Lock.tmpl-rw-r--r--.1Root root2786Mar in  ,: -pre-revprop-Change.tmpl-rw-r--r--.1Root root2122Mar in  ,: -Pre-Unlock.tmpl-rw-r--r--.1Root root2780Mar in  ,: -start-Commit.tmpl[[email protected] hooks]#

Change the following hook file template to an executable file

CP Post-commit.tmpl post-chmod +x post-

Vim Post-commit Add the following:

Export Lang=en_us. UTF-8
/USR/BIN/SVN update/var/www/html/test.com--username Wentao--password 123456

Web Publishing Directory Synchronization update

SVN Hook operation-Update web directory synchronously

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.