简体   繁体   English

jenkins 在 Git 中从哪里获取电子邮件地址

[英]Where does jenkins get email addresses from in Git

I have the latest version of Jenkins set up, along with the email extension plugin.我设置了最新版本的 Jenkins 以及电子邮件扩展插件。 Email is scheduled to be sent whenever a build fails to all the relevant patch authors.计划在构建失败时向所有相关补丁作者发送电子邮件。

The issue I am seeing is that the email being sent out is to email addresses that are out of date.我看到的问题是发送的电子邮件是过期的电子邮件地址。 I had my team update their local git config settings to make sure that new check ins are being registered with the current user email address, but this doesn't seem to correct the problem.我让我的团队更新了他们的本地 git 配置设置,以确保使用当前用户电子邮件地址注册新签入,但这似乎并没有解决问题。

Where does Jenkins get the e-mail addresses from in Git, and how do you update them when they aren't current? Jenkins 从 Git 中从哪里获得电子邮件地址,当它们不是最新的时如何更新它们?

UPDATE:更新:

Peter's answer is good info, but it only a start.彼得的回答是很好的信息,但这只是一个开始。 I have not completely solved this problem, but I have noticed something.我还没有完全解决这个问题,但我注意到了一些事情。 While there are permissions that git itself uses for check ins, GitHub can have multiple alternate email addresses, and there are a variety of other 3rd party tools that wrap or interact with Git.虽然 git 本身有用于签入的权限,但 GitHub 可以有多个备用电子邮件地址,并且还有各种其他 3rd 方工具可以包装 Git 或与 Git 交互。 (Visual Studio for example). (例如 Visual Studio)。

It seems that some of these tools can insert credentials into check ins.似乎其中一些工具可以将凭据插入到签入中。 If you are trying to solve this problem check the credentials of all the tools being used.如果您正在尝试解决此问题,请检查正在使用的所有工具的凭据。

Also, check the users page in Jenkins.另外,请检查 Jenkins 中的用户页面。 Jenkins automatically ingests in users it encounters while building branches, and if there are perms that were incorrectly entered (say, with a personal email address instead of a business address), they will show up there. Jenkins 会自动接收它在构建分支时遇到的用户,如果有错误输入的权限(例如,使用个人电子邮件地址而不是公司地址),它们将显示在那里。 This is a great way to find git users with bad git configurations.这是查找具有错误 git 配置的 git 用户的好方法。

Jenkins reads the commit data from the author associated with the commit, you can view these with Jenkins 从与提交相关联的作者处读取提交数据,您可以查看这些

git log

This will show for each commit这将为每次提交显示

Author: Author Name <you@example.com>

You can amend the author of an existing commit您可以修改现有提交的作者

git commit --amend --author="Author Name <you@example.com>"

To set the default author email for your machine为您的机器设置默认作者电子邮件

git config --global user.email "you@example.com"

and you can set it locally to the repository you're in currrently并且您可以在本地将其设置为当前所在的存储库

git config user.email "you@example.com"

Email Extension plugin电子邮件扩展插件

Developers开发商

Add this recipient provider to send the email to anyone who checked in code for the last build.添加此收件人提供程序以将电子邮件发送给签入上次构建代码的任何人。 This plugin will generate an email address based on the committer's ID and an appended Default user e-mail suffix from the Extended E-mail Notification section of the Configure System page.该插件将根据提交者的 ID 和附加的默认用户电子邮件后缀生成一个电子邮件地址,该后缀来自配置系统页面的扩展电子邮件通知部分。 For example, if a change was committed by someone with an ID of first.last, and the default user e-mail suffix is @example.com, then an email will be sent to first.last@example.com.例如,如果更改是由 ID 为 first.last 的某个人提交的,并且默认用户电子邮件后缀为 @example.com,则将向 first.last@example.com 发送一封电子邮件。

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

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