在SVN提交上触发Hudson [英] Trigger Hudson build on SVN commit

查看:63
本文介绍了在SVN提交上触发Hudson的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了一个版本控制系统(Subversion),开发人员将使用它来提交和更新其代码(假设其地址为 https:// server / svn /项目)。只有经过身份验证的用户才能访问项目的SVN。

I have already set up a version control system (Subversion) which is going to be used by developers to commit and update their code (let's say that its address is https://server/svn/project). Only authenticated users will be able to have access to project's SVN.

另一方面,我已将Hudson安装为项目的持续集成服务器(项目地址为 server:8080 / job / project )。

On the other hand, I have installed Hudson as the project's continuous integration server (address of the project is server:8080/job/project).

我想要实现以下目标:


  • 在进行SVN提交时,Hudson的构建会自动触发。

  • 邮件会发送给相应的开发人员(那些提交了代码的用户),如果他们的提交的代码没有构建,这意味着当用户A提交的代码没有构建时,只有用户A会收到一封包含通知的电子邮件。

我已经为Hudson用户设置了基于矩阵的授权,因为我不想向任何人开放。

I have set up matrix-based authorization for Hudson users, because I don't want to be open to anyone.

I已经看到有关提交后 c的钩子的一些建议,但是直到现在它们都没有起作用。

I have seen some suggestions for post-commit hooks, but none of them worked until now.

有人可以提出什么建议吗?在两个问题上都要做?具体步骤将不胜感激。

Can somebody suggest what to do regarding both issues? Specific steps would be appreciated.

推荐答案

根据>构建软件项目#由Subversion / CVS中的更改构建 ,Hudson需要轮询您的SVN rep以检测更改并触发构建。

According to "Building a software project # Builds by changes in Subversion/CVS", Hudson needs to poll your SVN repo in order to detect changes and trigger the build.

但是,可以在SVN的每次提交时启动,例如在该线程中

官方脚本位于 Subversion插件页。

However, that can be initiated on each commit from the SVN, like in this thread.
The official script is at the Subversion Plugin page.

REPOS="$1"
REV="$2"
UUID=`svnlook uuid $REPOS`
/usr/bin/wget \
  --header "Content-Type:text/plain;charset=UTF-8" \
  --post-data "`svnlook changed --revision $REV $REPOS`" \
  --output-document "-" \
  --timeout=2 \
  http://server/hudson/subversion/${UUID}/notifyCommit?rev=$REV

但已指定:

要使其正常工作,您的Hudson必须允许匿名读取系统访问权限

如果对Hudson的访问控制较为严格,则您可能需要指定用户名和密码,具体取决于身份验证的配置方式。

For this to work, your Hudson has to allow anonymous read access to the system.
If access control to your Hudson is more restrictive, you may need to specify the username and password, depending on how your authentication is configured.

这篇关于在SVN提交上触发Hudson的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆