Automatically update the catalog after SVN submission

Source: Internet
Author: User
Tags svn

The directory of the Web site needs to be automatically deployed after the local sync svn, and the following data will be collated:
1. Create SVN directory

Mkdir/var/www/project

2, from the server's local SVN checkout the latest version of the code to the WWW directory in the project folder, note that the local SVN server address and port number is started when the SVN service is set up, according to their own configuration changes

SVN co svn://localhost:9999/project/var/www/project--username ' uname '--password ' pwd '

3, in the SVN code warehouse in the corresponding project directory to create post-commit files, if the file already exists, please empty the contents of the file and then edit

Cd/var/svn/project/hooks
Vim Post-commit

4, add the following code in the file, save

#!/bin/sh
export Lang=en_us.utf8
svn_path=/usr/bin/svn
web_path=/var/www/project 
$SVN _path Update $WEB _path--username ' uname '--password ' pwd '--no-auth-cache

5, modify the Post-commit users to the WWW user, to Post-commit to add execution rights:

Chown apache:apache post-commit
chmod 755 post-commit

6, at this point, the local SVN directory synchronization, the server's corresponding directory will also be updated, keep the automatic sync attached CentOS under the lamp configuration:

http://blog.csdn.net/cx118118/article/details/70209956

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.