SVN hook synchronously updates SVN to Web Server

Source: Internet
Author: User
Tags svn update

Go to the hooks directory of the svn project.
Create a post-commit file. The content is as follows:
#===================================================== ====================================
Export lang = zh_CN.UTF-8
Web =/www/vhost
SVN update $ Web -- username user -- password passwd -- no-auth-Cache
#===================================================== ====================================
You must specify the character set.
The user name and password are required to run SVN update and do not cache user authentication tokens.
Export lang = zh_CN.UTF-8
-- Username user -- password passwd -- no-auth-Cache
Otherwise, an error is reported when SVN commit:
Error: Merge of '...': 200 OK ........

 

 

Assume that the external access domain name of the server is http://yemaosheng.com/website file stored in/var/www/html/ye/
Modify the post-commit file in the svn Library
Operations include:
CD/var/www/SVN/repos/hooks/
Cppost-commit.tmpl post-commit
Chown Apache: Apache post-commit
Chmod A + X Post-commit
VI post-commit
#! /Bin/sh
Repos = "$1 ″
REV = "$2 ″
SVN update/var/www/html/Ye-username svnuser1-Password 123456

PS: the above operations should be true, but I tested on my fc8 server no effect, it is estimated that the problem of UTF-8.
I had to use crontab to run sh every 5 minutes instead.
#! /Bin/sh
Export lang = zh_CN.UTF-8 # Note: This line hurt me a few hours
SVN update/var/www/html/Ye-username root-Password 123456

If skipped is prompted, you must first check a working version to this web directory.

For example:

SVN Co file: // home/SVN/xdadmin file: // var/www/xdadmin

Go to the hooks directory of the svn project.
Create a post-commit file. The content is as follows:
#===================================================== ====================================
Export lang = zh_CN.UTF-8
Web =/www/vhost
SVN update $ Web -- username user -- password passwd -- no-auth-Cache
#===================================================== ====================================
You must specify the character set.
The user name and password are required to run SVN update and do not cache user authentication tokens.
Export lang = zh_CN.UTF-8
-- Username user -- password passwd -- no-auth-Cache
Otherwise, an error is reported when SVN commit:
Error: Merge of '...': 200 OK ........

 

 

Assume that the external access domain name of the server is http://yemaosheng.com/website file stored in/var/www/html/ye/
Modify the post-commit file in the svn Library
Operations include:
CD/var/www/SVN/repos/hooks/
Cppost-commit.tmpl post-commit
Chown Apache: Apache post-commit
Chmod A + X Post-commit
VI post-commit
#! /Bin/sh
Repos = "$1 ″
REV = "$2 ″
SVN update/var/www/html/Ye-username svnuser1-Password 123456

PS: the above operations should be true, but I tested on my fc8 server no effect, it is estimated that the problem of UTF-8.
I had to use crontab to run sh every 5 minutes instead.
#! /Bin/sh
Export lang = zh_CN.UTF-8 # Note: This line hurt me a few hours
SVN update/var/www/html/Ye-username root-Password 123456

If skipped is prompted, you must first check a working version to this web directory.

For example:

SVN Co file: // home/SVN/xdadmin file: // var/www/xdadmin

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.