git - Jenkins 使用错误的邮件地址来邮寄构建结果

标签 git jenkins jenkins-plugins

我正在使用 Jenkins 的 ext-mail 和 git 插件来运行构建作业。当对存储库进行提交时,构建会按预期触发,但使用错误的邮件地址来邮寄构建结果。我的.gitconfig:

[core]
  symlinks = false
  autocrlf = true
[user]
  name = Some One
  email = <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="42312d2f272d2c2702262d2f232b2c6c212d2f" rel="noreferrer noopener nofollow">[email protected]</a>
[color]
  ui = true
[merge]
  tool = bc3
[pack]
  packSizeLimit = 2g
[help]
  format = html
[diff]
  tool = bc3
[rebase]
  autosquash = true

但是构建日志表明选择了不同的邮件地址:

Sending email for trigger: Success
NOT overriding default server settings, using Mailer to create session
messageContentType = text/plain; charset=UTF-8
Adding user address <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1f6c70727a70717a5f5b5a4c544b504f325a2f534f5b5759317b70727e76713173707c7e73" rel="noreferrer noopener nofollow">[email protected]</a>, they were not considered an excluded committer
Successfully created MimeMessage
Sending email to: <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5f2c30323a30313a1f1b1a0c140b100f721a6f130f1b1719713b30323e36317133303c3e33" rel="noreferrer noopener nofollow">[email protected]</a>
Finished: SUCCESS

我是否忘记了一些设置?

谢谢!

最佳答案

明白了。看起来用户所做的第一个操作是在 .gitconfig 文件中未配置邮件地址。 Jenkins 存储了该用户的默认地址 ($JENKINS_HOME/users/someone/)。编辑此文件并重新启动 jenkins 似乎可以解决该问题。

关于git - Jenkins 使用错误的邮件地址来邮寄构建结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35152372/

相关文章:

Git - 忽略特定文件夹中包含的某些文件

continuous-integration - 如何使用jenkins、rvm和cucumber搭建CI环境

jenkins - 如何与 Jenkins 并行运行相同的工作多次?

Groovy 从文件中获取变量。变量=值

Git 在签署提交时停止询问密码

svn - 当主干/分支/标签结构一团糟时,如何从 Subversion 迁移到 Mercurial?

docker - Jenkins 和 Docker 设备上没有空间 - 如何正确清理

jenkins - 如何防止在 Bitbucket 组织作业风格中的同一存储库中并发构建不同分支?

git - 将 .gitignore 添加到 gitignore

java - 错误 : "Copying the source file <Unknown>"