最近要将某个目录做samba共享出去,而想通过svn同步文档到svn,然后通过svn hooks 同步到共享目录,实现自动化
现在svn服务器和samba server再同一台机器上:
在svn路径下找到hooks目录,下面有很多脚本如下:
post-commit.tmpl post-unlock.tmpl pre-revprop-change.tmpl
post-lock.tmpl pre-commit.tmpl pre-unlock.tmpl
post-revprop-change.tmpl pre-lock.tmpl start-commit.tmpl
每个脚本都有对应的意义,在哪个阶段执行
现在用cp post-commit.tmpl post-commit
vim post-commit
#/bin/bassh REPOS="$1" REV="$2" WEB_PATH="/data/svn/www" TEST_PATH="/data/samba/testx/www.h.cn" export LANG=zh_CN.UTF-8 CURDATE=`date` echo "Code Deployed By at $CURDATE" > /data/logs/code_deploy_log 2>&1 /usr/local/bin/svn update --username xxx --password xxx /home/apache/htdocs/ > /data/logs/code_deploy_log 2>&1
时间: 2024-10-10 15:52:17