CENTOS7 Configuring the SVN hook hooks script to automatically synchronize the code to the project directory

Source: Internet
Author: User
Tags svn update

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

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.