Mercurial 变更组挂钩未触发; Linux

发布于 2024-09-24 08:27:32 字数 822 浏览 3 评论 0原文

我有一台服务器,为“中央”Mercurial 存储库提供服务;团队克隆它并通过 ssh 将更改推送到它。 Hudson 安装在同一台服务器 (RHEL 5.5) 上。我希望每当有人推送到中央 Mercurial 存储库时都会触发 Hudson 构建。我还希望在推送时发送通知电子邮件。

在 ProjectName/.hg/.hgrc 中有以下内容:

[hooks]
changegroup.hudson = wget http://Server.Name:8080//job/Project_Name/builds?delay=0sec >&2

如果我使用 putty ssh 到此服务器,然后发出 wget 命令,则会成功触发构建,所以我不认为这是权限问题。

另一个钩子是:

changegroup.notify = /the/path/.hg/hooks/notify

其中通知是:

dest='comma separated list of email addresses'
repo="path/to/repository/"
subject="New changesets in $repo"

hg glog -l 10 -r $HG_NODE: | mail -s "$subject" $dest

当我直接从 shell 运行 ./notify 时,当我位于中央存储库的路径中时,邮件会正确发送;如果我从主目录执行通知,则找不到存储库并且我收到一封空电子邮件,但至少我收到一封电子邮件。我认为这些钩子只是没有运行。

可能有什么障碍?我应该检查什么?

I have a server which serves a "central" Mercurial repository; the team clones it and pushes their changes up to it via ssh. Hudson is installed on the same server (RHEL 5.5). I wish to trigger a Hudson build whenever anyone pushes to the central Mercurial repository. I also wish to send a notification email upon a push.

In ProjectName/.hg/.hgrc there is the following:

[hooks]
changegroup.hudson = wget http://Server.Name:8080//job/Project_Name/builds?delay=0sec >&2

If I use putty to ssh to this server and then issue the wget command, a build is successfully triggered, so I don't think it's a permissions issue.

Another hook is:

changegroup.notify = /the/path/.hg/hooks/notify

where notify is:

dest='comma separated list of email addresses'
repo="path/to/repository/"
subject="New changesets in $repo"

hg glog -l 10 -r $HG_NODE: | mail -s "$subject" $dest

When I run ./notify directly from the shell, the mail is sent correctly when I am in the central repository's path; if I execute notify from my home directory, the repository is not found and I get an empty email, but at least I get an email. I assume these hooks are just not being run.

What could be getting in the way? What should I check?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

十雾 2024-10-01 08:27:32

运行 cd 项目名称; hg showconfig|grep 钩子。

我打赌你不会看到你的钩子,如果这正是你所拥有的:

在 ProjectName/.hg/.hgrc 中有以下内容:

存储库范围的 hgrc 是 .hg/hgrc 不带点。

Run cd ProjectName; hg showconfig|grep hooks.

I bet your don't see your hooks, if this is exactly what you have:

In ProjectName/.hg/.hgrc there is the following:

Repository-wide hgrc is .hg/hgrc without dot.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文