1. linux命令行内进入SVN库目录.

cd /data/svn/code

2.然后进入hooks目录,此目录是可被SVN执行的钩子文件, 当前全部是示例文件, 后缀名均为*.tmpl.  找到post-commit.tmpl. 将其重新命名为post-commit, 并改为可执行权限, 在其尾部替换原有代码为如下代码.

REPOS="$1"
REV
="$2"
LAST_COMMIT_PATH
=`svnlook dirs-changed /data/svn/code`
php $DIR
/svn-hudson.php $LAST

3.在hooks目录建立一个名称为svn-hudson.php的文件, 并且填入如下内容:

<?php
//只有SVN路径是自己指定的才触发hudson构建, 如果SVN库没有只监视特定子目录要求则不需加此判断.
if( substr( $argv[1] , 0 , 3 ) == 'php' )
{
file_get_contents(
'http://localhost/hudson/job/Rainbow/build?token=yourToken' );
}

相关文章:

  • 2022-12-23
  • 2021-11-29
  • 2021-06-30
  • 2022-01-01
  • 2022-12-23
  • 2021-03-31
  • 2022-12-23
  • 2022-01-14
猜你喜欢
  • 2022-01-17
  • 2022-03-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案