jenkins配置邮件通知

 

说明:通过配置jenkins邮件通知,以达到根据构建结果以邮件方式通知到对应的负责人

1.安装插件Email Extension Plugin

2.配置SMTP服务器:jenkins → 系统管理 → 系统设置 → Extended E-mail Notification(具体如下)

  SMTP server:smtp.global-mail.cn

  Advance Setting中使用smtp authentication,填入用户名和密码

  Use SSL:勾选

  SMTP port:465

3.安装邮件通知模版

  1. 在JENKINS_HOME(jenkins家目录)目录下创建email-templates目录,注意属主属组要和jenkins运行用户保持一致
  2. 模版下载地址:https://raw.githubusercontent.com/jenkinsci/email-ext-plugin/master/src/main/resources/hudson/plugins/emailext/templates/groovy-html.template
  3. 模版下载到email-templates目录中,并保存

4.配置JOB中的邮件通知

  1. 在Post-build Actions选择Editable Email Notification
  2. Project Recipient List 填写收件人邮箱地址,多个地址以","隔开
  3. Content Type 选择 HTML(text/html)
  4. Default Content 填写:${SCRIPT, template="groovy-html.template"}
  5. 在Advanced Settings中,Triggers → Failure - Any → Send To → Recipient List 如下图
  6. 最后保存
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值