Automatically update SVN content to the website

Source: Internet
Author: User
Tags svn

Each time you write the site code, are copied to the server manually and then look at the effect, now you can automatically update the site through SVN code, the following method:

1. Write Batch Processing

"C:\Program files\subversion\bin\svn.exe" Export--force--no-auth-cache--quiet svn://xxxxxx [path]--username [ Username]--password [password]

Related parameter Description:

1. C:\Program FILES\SUBVERSION\BIN\SVN.EXE,SVN Program Path

2. Export command

3 、--force, overwrite original file, overwrite if original file exists, otherwise error

4 、--No-auth-cache, do not cache authentication, this must be written, or you call in the PHP site, there will be a hint, but you do not see the console window, the program will always be stuck there do not exit, plus this parameter will not cache authentication information, there will be no error

5 、--quiet, exit after running

6, svn://xxxxxx, need to export the SVN path

7, [path], export to a local path, specified as the directory of the Web site can be

8 、--username [USERNAME],SVN's account

9 、--Password [PASSWORD],SVN's password

2, through the above batch processing, you can export the specified SVN path to a locally specified directory, complete the site update, and then set up SVN hooks, you can commit the code after the automatic execution of the above batch processing.

Under directory hooks of the SVN repository, locate the Post-commit.tmpl file, rename it as: Post-commit.bat, comment out: mailer.py commit "$REPOS" "$REV"/path/to/ Mailer.conf

Enter the batch name above, or you can directly input the batch command above.

If your code base and Web site are not on the same server, you can also create a site page on the site server, which is used to perform the batch processing above, and then

Post-commit.bat Call this page, you can also implement the two servers automatically update the code function.

Methods to invoke the Web site in batch processing:

Examples are as follows:

Start http://www.xxxx.com/update.php

Automatically update SVN content to the website

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.