Automatically deploy code using the svn post-COMMIT hook

Source: Internet
Author: User
Use the svn post-COMMIT hook to automatically deploy the code. after submitting the code to SVN during the development process, use the SVN hook and use the post-commit script, execute the svnupdate operation under the root of the target folder to synchronize the update content to the test environment, making development and debugging very convenient. Post-c... use the svn post-COMMIT hook to automatically deploy the code. after submitting the code to SVN during the development process, use the SVN hook and use the post-commit script.
Run the svn update operation under the root directory of the standard folder to synchronize the update content to the test environment, making development and debugging very convenient. Post-commit content :--------------------------------------------#! /Bin/sh # Change to service code export LANG = zh_CN.gb2312 # Set variableREPOS = "$1" REV = "$2" SVN =/usr/bin/svnWEB =/data/home /htdocsLOG =/data/home/auto_svn.log # update the code from the SVN $ SVN update $ WEB -- username -- password -- non-interactive #........ .............. if [$? = 0] then echo "$ REPOS" "$ REV"> $ LOG echo 'date'> $ LOG echo "############ ################# "> $ LOGfi ----------------------------------------------- note: 1. use export to specify the encoding. 2. specify the full svn path. 3. after the code CO is released, you can test the post-commit script. Because svn hooks does not contain any environment variables during execution, we cannot test the code through simple./post-commit. You must use commands such as sudo su to switch to the svn or apache server to run the user. use the following method to test the Python code env-./post-commit.

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.