Ubuntu 配置svn钩子

在svn版本库找到 hooks文件夹
mv post-commit.tmpl post-commit
#!/bin/sh
export LANG=en_US.UTF-8

REPOS="$1"
REV="$2"
TXN_NAME="$3"

SVN=/usr/bin/svn
SVNLOOK=/usr/bin/svnlook
NEW_VER=`$SVNLOOK youngest $REPOS`

# 修改文件
changeFile=$($SVNLOOK changed  -r $NEW_VER $REPOS)
# 操作人
author=$($SVNLOOK author -r $NEW_VER $REPOS)
# commit
commit=$($SVNLOOK log $REPOS)

param="changeFile=$changeFile&author=$author&commit=$commit"

curl -X POST -d "$param" http://work.staging.hzfapi.com/hook-svn

svn命令参考

猜你喜欢

转载自blog.51cto.com/jinliang/2346755