#! /Bin/sh
# Post-commit hook
#
# The post-commit hook is invoked after a commit. Subversion runs
# This hook by invoking a program (script, executable, binary, etc .)
# Named 'post-commit '(for which this file is a template) with
# Following ordered arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] Rev (the number of the revision just committed)
#
# The default working directory for the invocation is undefined, so
# The program shoshould set one explicitly if it cares.
#
# Because the commit has already completed and cannot be undone,
# The exit code of the hook program is ignored. The hook Program
# Can use the 'svnlook' utility to help it examine
# Newly-committed tree.
#
# On a UNIX system, the normal procedure is to have 'post-commit'
# Invoke other programs to do the real work, though it may do
# Work itself too.
#
# Note that 'post-commit 'must be executable by the user (s) who will
# Invoke it (typically the user httpd runs as), and that user must
# Have filesystem-level permission to access the repository.
#
# On a Windows system, you should name the hook Program
# 'Post-commit. bat' or 'post-commit.exe ',
# But the basic idea is the same.
#
# The Hook program typically does not inherit the environment
# Its parent process. For example, a common problem is for
# PATH environment variable to not be set to its usual value, so
# That subprograms fail to launch unless invoked via absolute path.
# If you're having unexpected problems with a hook program,
# Culprit may be unusual (or missing) environment variables.
#
# Here is an example hook script, for a UNIX/bin/sh interpreter.
# For more examples and pre-written hooks, see those in
# The Subversion repository
# Http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and
# Http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/
Repos = "$1"
REV = "$2"
# Echo "$ repos"
# Echo "$ rev"
Echo "(exit_code = 100 means success. ^)"> & 2
Echo ""> & 2
Gameop = 0
Dataadmin = 0
Testsvr = 0
For VaR in 'svnlook dirs-changed/data/SVN/online_publish/'; do
If ['echo $ var | grep "productsvr/gameop/" | WC-C'-GT 0]; then
Gameop = 1;
Fi
If ['echo $ var | grep "productsvr/dataadmin/" | WC-C'-GT 0]; then
Dataadmin = 1;
Fi
If ['echo $ var | grep "testsvr/" | WC-C'-GT 0]; then
Testsvr = 1;
Fi
Done
If [$ gameop-EQ 1]; then
Echo 'gameop changed '> & 2
# Main gameop
Echo "@ x. x:"> & 2
/Data/rpc. py-HX. x-supdate_svn_online_publish.sh-aproductsvr/gameop/> & 2
Fi
Echo "update complete! "> & 2
Exit 100
This article is from the "muzinan technology blog" blog, please be sure to keep this source http://muzinan110.blog.51cto.com/684213/1440888
SVN hooks post-commit (automatic game release)