Because of the project needs, the SVN post code wants to test the server again, after each commit to manually go to SVN update once very troublesome, the configuration of the SVN hooks will save the trouble.
Go to SVN repository directory find hooks directory Find file Post-commit.tmpl copy out a file named Post-commit, and modify permission to execute permission
The command is as follows:
CD/VAR/DATA/SVNDATA/MYPROJECT/HOOKSCP post-commit.tmpl post-commitchmod 755 post-commit vim post-commitREPOS= "$" REV = "$" #mailer. Py commit "$REPOS" "$REV"/path/to/mailer.confexport lc_all= "ZH_CN. UTF-8 "Expor lang=" en_US. UTF-8 "#svn命令目录SVN =/usr/bin/svn# project directory web=/usr/local/nginx/html/ipengbei# execute the update code to the specified project directory $svn update $WEB -- Username L*****g--password l****8# The following is required for the output log curdate = ' Date ' echo ' Code to $CURDATE $REPOS $REV ">>/root/code- hooks.log# above for output logs requires chown-r 755 $WEB
CENTOS7 Configuring the SVN hook hooks script to automatically synchronize the code to the project directory