【问题标题】:Hudson git failed to send out build failure email toHudson git 未能将构建失败电子邮件发送到
【发布时间】:2010-09-19 07:19:30
【问题描述】:

如何配置 git user.name 以使 Hudson 向提交代码的用户发送电子邮件?

我只是按照标准方式用“用户名(userid)”配置git user.name,见下文。

git config --global user.name "Euler XXXX(欧拉)"

git config --global user.email "euler.xxxx@server.com"

然后我将代码提交到 git 存储库,这会触发 Hudson 构建。但未能通过电子邮件euler.xxxx@server.com 向我发送电子邮件。

查看哈德逊日志如下:

...
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Fri Sep 10 15:05:51 CST 2010
[INFO] Final Memory: 3M/74M
[INFO] ----

--------------------------------------------------------------------


**Failed to send e-mail to Euler XXXX (euler) because no e-mail address is known, and no default e-mail domain is configured**
...

在 Hudson 配置中,我配置了“LDAP Email Lookup”,由 Hudson LDAP 电子邮件插件提供。

如果我在我的 LDAP 服务器中将 user.name 配置为 userid,即 userid,那么 Hudson 构建可以找到电子邮件地址。

【问题讨论】:

    标签: git hudson


    【解决方案1】:

    看起来写这个blog post的人设法解决了你遇到的问题。虽然看起来好像没有进插件,所以还是得自己编译插件。

    【讨论】:

    • 这已在大约一年前合并到插件中。我们使用的是旧版本的插件,我得看看能不能说服别人更新它。谢谢! :)
    【解决方案2】:

    您需要访问“人员”页面 (/people/) 并为该用户添加一个电子邮件地址(位于 /user/{username})。 git 插件会忽略 git config 电子邮件地址。

    【讨论】:

      【解决方案3】:

      git config --global 写入全局 ~/.gitconfig 文件

      您的问题来自这样一个事实,即您键入 git config 时使用的 ~ 与实际执行 Hudson 作业的用户使用的 ~ 不同。

      检查并确保实际参与该 Hudson 作业执行的用户主页。

      【讨论】:

      • 谢谢! hudson 服务器在其他用户 A 下执行以进行交互。而用户 B 提交代码。我只是希望电子邮件通知用户 B。
      猜你喜欢
      • 1970-01-01
      • 2017-12-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-09
      • 2016-07-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多