svn hooks post-commit钩子自动部署

#!/bin/sh
#修改为服务编码
export LANG=zh_CN.utf-8

#Set variable
REPOS="$1"
REV="$2"


SVN=/usr/bin/svn
WEB=/home/www/develop
LOG=/var/log/svn/post-commit.log

#update the code from the SVN
$SVN update $WEB --username username --password passwd --non-interactive

chown -R www-data:www-data $WEB
chmod -R 755 $WEB

#......................
if [ $? == 0 ]
then
    echo  "$REPOS" "$REV" >> $LOG
    echo `date` >> $LOG
    echo "##############################" >> $LOG
fi

  

posted @ 2016-11-11 12:16  xyyphp  阅读(1328)  评论(0编辑  收藏  举报