简体   繁体   English

Hudson git未能发送构建失败的电子邮件给

[英]Hudson git failed to send out build failure email to

How to configure the git user.name to enable Hudson send out email to the user who commit code? 如何配置git user.name以启用Hudson向提交代码的用户发送电子邮件?

I just follow the standard way to configure the git user.name with "User Name (userid)", see below. 我只是按照标准方式配置git user.name和“User Name(userid)”,见下文。

git config --global user.name "Euler XXXX (euler)" git config --global user.name“Euler XXXX(euler)”

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

Then I commit the code to git repository, which trigger Hudson build. 然后我将代码提交给git repository,它会触发Hudson构建。 But it was failed to send out the email to me with email euler.xxxx@server.com . 但它没有通过电子邮件euler.xxxx@server.com向我发送电子邮件。

See the Hudson log as below: 请参阅Hudson日志,如下所示:

...
[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**
...

In Hudson configuration, I configured " LDAP Email Lookup ", which provided by Hudson LDAP email plugin. 在Hudson配置中,我配置了“ LDAP Email Lookup ”,它由Hudson LDAP电子邮件插件提供。

While if I configure the user.name with the userid , which is userid in my LDAP server, then the Hudson build can find email address. 而如果我配置user.nameuserid ,这是userid在我的LDAP服务器,那么哈德森构建能找到的电子邮件地址。

You need to visit the "People" page (/people/) and add an email address for this user (at /user/{username}). 您需要访问“人员”页面(/ people /)并为该用户添加电子邮件地址(在/ user / {username})。 The git config email address gets ignored by the git plugin. git配置电子邮件地址被git插件忽略。

It looks like the guy who wrote this blog post managed to fix the problem you are having. 看起来写这篇博文的人设法解决了你遇到的问题。 Although it doesn't look like it has made it into the plugin, so you have to compile the plugin yourself. 虽然它看起来并不像是插入插件,但你必须自己编译插件。

git config --global writes to global ~/.gitconfig file . git config --global写入全局〜/ .gitconfig文件

Your problem comes from the fact that ~ used when you typed the git config is not the same than the ~ used by the user actually executing the Hudson job. 你的问题来自于一个事实,即~使用时您键入的git config不低于同~使用的实际执行哈德森作业的用户。

Check and make sure of the user home actually involved in that Hudson job execution. 检查并确保实际涉及Hudson作业执行的用户主页。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM