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