jenkins 怎么配置阿里企业邮箱进行email发送

jenkins 怎么配置阿里企业邮箱进行email发送

经过务必艰辛的查资料,分析问题,终于搞定了!!希望可以让大家少走弯路

例1:基本原理

"""
与配置其它邮箱不同,有多个注意事项如下:
1 SMTP Password 阿里邮箱不用“授权码”,直接用账号,密码就可以
2 SMTP server 阿里邮箱的服务器填写为:smtp.mxhichina.com
3 SMTP Port 端口用:25
4 Use SSL 不勾选 “use ssl”
"""

例2:工作中实例

怎么一步一步配置呢?

"""
思路如下:
安装好插件后(具体插件,自行查询,暂不赘述了),需要配置的地方共4处:
1 系统管理》系统配置》Jenkins Location
2 系统管理》系统配置》Extended E-mail Notification
3 系统管理》系统配置》邮件通知
4 构建job》配置》构建后操作》Editale Email Notification
详情情况下图s:
"""

1 系统管理》系统配置》Jenkins Location
无

2 系统管理》系统配置》Extended E-mail Notification
接下图
接上图
接上图

<!DOCTYPE html>    
<html>    
<head>    
<meta charset="UTF-8">    
<title>${ENV, var="JOB_NAME"}-第${BUILD_NUMBER}次构建日志</title>    
</head>    
    
<body leftmargin="8" marginwidth="0" topmargin="8" marginheight="4"    
    offset="0">    
    <table width="100%" cellpadding="0" cellspacing="0"  style="font-size: 11pt; font-family: Tahoma, Arial, Helvetica, sans-serif">    
        <tr>    
            本邮件由系统自动发出,无需回复!<br/>            
            大家好,以下为 ${PROJECT_NAME } 项目构建信息</br> 
            <td><font color="#CC0000">构建结果 - ${BUILD_STATUS}</font></td>   
        </tr>    
        <tr>    
            <td><br />    
            <b><font color="#0B610B">构建信息</font></b>    
            <hr size="2" width="100%" align="center" /></td>    
        </tr>    
        <tr>    
            <td>    
                <ul>    
                    <li>项目名称 : ${PROJECT_NAME}</li>    
                    <li>构建编号 : 第${BUILD_NUMBER}次构建</li>    
                    <li>触发原因: ${CAUSE}</li>    
                    <li>构建状态: ${BUILD_STATUS}</li>    
                    <li>构建日志: <a href="${BUILD_URL}console">${BUILD_URL}console</a></li>    
                    <li>构建URL: <a href="${BUILD_URL}">${BUILD_URL}</a></li>    
                    <li>测试报告: <a href="${PROJECT_URL}${BUILD_NUMBER}/allure/">${PROJECT_URL}${BUILD_NUMBER}/allure/</a></li>    
                </ul>    

<h4><font color="#0B610B">失败用例</font></h4>
<hr size="2" width="100%" />
$FAILED_TESTS<br/>

<h4><font color="#0B610B">最近提交(#${GIT_REVISION})</font></h4>
<hr size="2" width="100%" />
<ul>
${CHANGES_SINCE_LAST_SUCCESS, reverse=true, format="%c", changesFormat="<li>%d [%a] %m</li>"}
</ul>
详细提交: <a href="${PROJECT_URL}changes">${PROJECT_URL}changes</a><br/>

            </td>    
        </tr>    
    </table>    
</body>    
</html>

3 系统管理》系统配置》邮件通知
接着往下滑,就到了“邮件通知”模块
在这里插入图片描述
4 构建job》配置》构建后操作》Editale Email Notification
我除了单独配置收件人list,其它配置项较少,可自行添加比如Attachments什么的。。。

这里配置的比较少,很多都是默认的。这里单独指定一下收件人

》》》各位同学,要是对您有用,请帮我点个赞呗!
》》》有任何意见&建议,希望咱们在评论区交流!

  • 5
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
首先,你需要确保已经安装了 Jenkins,并且在你的服务器上已经配置好了阿里云的镜像地址。 以下是配置 Jenkins 使用阿里云镜像的步骤: 1. 打开 Jenkins 的管理界面,点击左侧菜单栏的 "Manage Jenkins"。 2. 在 "Manage Jenkins" 页面,点击 "Manage Plugins"。 3. 在 "Manage Plugins" 页面,切换到 "Available" 选项卡,并在搜索框中输入 "Config File Provider"。找到对应的插件,勾选并点击 "Install without restart" 安装该插件。 4. 安装完成后,返回到 Jenkins 的管理界面,再次点击 "Manage Jenkins"。 5. 在 "Manage Jenkins" 页面,点击 "Managed files"。 6. 在 "Managed files" 页面,点击 "Add a new Config"。 7. 在 "Config file type" 下拉框中选择 "Custom file",点击 "OK"。 8. 在 "Name" 输入框中填写一个名称(比如 "aliyun-mirror")。 9. 在 "Content" 输入框中粘贴以下内容: ```bash # 修改 Docker 镜像源为阿里云镜像 FROM ubuntu:latest RUN echo 'deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse' > /etc/apt/sources.list \ && echo 'deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse' >> /etc/apt/sources.list \ && echo 'deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse' >> /etc/apt/sources.list \ && echo 'deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse' >> /etc/apt/sources.list \ && echo 'deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse' >> /etc/apt/sources.list \ && echo 'deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse' >> /etc/apt/sources.list \ && echo 'deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse' >> /etc/apt/sources.list \ && echo 'deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse' >> /etc/apt/sources.list ``` 10. 点击 "Save" 保存配置文件。 配置完成后,你可以在 Jenkins 的 Job 中使用该配置文件。在你的 Job 中选择 "配置",然后在 "Build Environment" 部分勾选 "Provide Configuration files",并选择 "Custom files"。在 "Files to copy" 中选择 "aliyun-mirror" 配置文件。 这样,Jenkins 在每次构建时都会使用该配置文件,从而将 Docker 镜像源修改为阿里云镜像。请确保你的服务器能够访问到阿里云的镜像服务。 希望对你有帮助!如果还有其他问题,请随时提问。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值