当前位置:网站首页>Jenkins - email notification plug-in
Jenkins - email notification plug-in
2022-06-28 02:14:00 【wumingxiaoyao】
introduction
utilize Jenkins establish Pipeline Job To achieve CICD, Email notification each Job The operation of is very necessary . Especially testing , Report the test case execution results , So this article introduces the related Jenkins Email notification plug-in ,Mailer Plugin and Email Extension Plugin.
Summary :
- Email Plugin
Mailer Plugin
Email Extension Plugin - Email Notification Jenkins The system configuration
- Email Extension Plugin application
- TroubleShooting Troubleshooting
Email Plugin
This paper mainly introduces 2 individual Email Plugin,Mailer Plugin and Extended E-mail Notification Plugin
Mailer Plugin
install Jenkins Suggested Plugin after , By default... Will be installed Mailer Plugin, Just for email notification Build result , Lack of customization space .
open Job Configure, It opens at Add post-build action Will see E-mail Notification Options 
add to E-mail Notification Few configurable options .
Email Extension Plugin
Email Extension Plugin Allows you to fully and flexibly configure email notifications , You can customize when mail is sent , Who should receive the mail , What is the content of the email .
adopt Manage Jenkins -> Plugin Manager To install the plug-in 
After successful installation , open Job Configure page , It opens at Add post-build action Will see Editable Email Notification Options 
Email Notification Jenkins The system configuration
Want to pass Jenkins Email sent successfully , Need to pass through Manage Jenkins -> Configure System To configure SMTP Sending server and Admin mailbox .
What I have configured is iCloud mailbox , Need to Apple Official website Find a way to iCloud Mail server settings for the e-mail client . Other emails are similar , Find the corresponding configuration information .
Applicable to sending server SMTP Information Server name :smtp.mail.me.com
If you need SSL: yes If you are using SSL When you see the error message , Please try using TLS or STARTTLS.
port :587
If you need SMTP Identification of : yes
user name : Your integrity iCloud E-mail address ( for example ,[email protected], instead of emilyparker)
password : Use the App Special password .
Each mailbox smtp Server and supported protocols The mailbox configuration is mentioned In particular :
about ssl/tls encryption , Use 465 port
about starttls In general use 587 port
Mailer Plugin Configuration of
stay E-mail Notifiction part , The configuration is as follows :
stay Jenkins Location Part of the configuration Admin mailbox , Be careful : Not set up Admin Mailbox cannot send mail , This Admin E-mail must follow SMTP authentication The sender mailbox in the configuration is consistent .
Email Extension Plugin To configure
stay Extended E-mail Notification part ,SMTP and Admin The mailbox settings are the same as Mailer Plugin equally , I won't repeat it here .
You can also set the default recipient , List of respondents , Of course, if in Job Configure There are configurations in that will override the default settings , Or access variables $DEFAULT_RECIPIENTS and $DEFAULT_REPLYTO Use the default settings directly .

Default email Subject and Content, Empathy Job Configure The settings in will override the default settings .
The conditions that trigger email notifications can also be overridden

It opens at Content Token Reference You can see the description of the available variables of the plug-in , Use... When customizing message headers and content . Please refer to Jenkins - Built in variable access The article specifically lists the mail configuration variables .
Here are some common variables
Build The cause of the trigger , such as : It may be caused by some Pipeline job The trigger 
The message content is from a file , This is more commonly used , Content files can be generated by scripts , Be careful PATH yes workspace Relative path to root .
Email Extension Plugin application
stay Job Configure in ,Add build-post actions add to Editable Email Notification
Be careful : Email attachment , And content documents PATH It's all based on workspace Relative path to root . If the message content is also embedded with pictures , You also need to add this picture to the attachment , Generated html Just apply this image directly to the content , No additional paths are required .
<img src="cid:trend_image.png">

Click on Advance
Set up Mail trigger condition ,Always It doesn't matter build What state , Send email notifications .
Set up recipients , There's a little pit here , The default may be to Developers add , This results in a custom recipient list for each recipient , And other people , This other person is still dynamic every day , It was later discovered that these dynamic recipients actually have submitted PR Code change people . If you don't want these people to receive emails, you have to remove them .

The following is the email notification content after application : For the sake of content sensitivity, the fuzzy processing is carried out , Just know the general content 
TroubleShooting Troubleshooting
Through arbitrary SMPT Service needs TLS To send email notifications , Default Jenkisn yes Disable 了 mail.smtp.starttls Options , I'm through icloud SMTP Service , And it uses 587 port , This is an application starttls , need Enable This option .
If Disable This option , You will receive the following exception :com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first
Windows Solution :
- open Jenkins The installation directory , Can pass Jenkins UI To know the installation directory Manage Jenkins find Home directory attribute . The default installation path is C:\Program Files (x86)\Jenkins
- open jenkins.xml And add -Dmail.smtp.starttls.enable=true stay arguments part
<executable>%BASE%\jre\bin\java</executable>
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -Dmail.smtp.starttls.enable=true -jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war"</arguments>
- restart Jenkins: adopt URL {base_jenkins_url}/restart
Linux Please refer to :Fixing SMTPSendFailedException on Ubuntu 16.04
边栏推荐
- Fundamentals of scala (3): operators and process control
- Numpy----np. meshgrid()
- MySQL十种锁,一篇文章带你全解析
- Overview of drug discovery-01 overview of drug discovery
- TD Hero 线上发布会|7月2日邀你来
- 嵌入式必学,硬件资源接口详解——基于ARM AM335X开发板 (上)
- [Yocto RM] 4 - Source Directory Structure
- Capacitor
- Lmsoc: a socially sensitive pre training method
- Prometeus 2.35.0 新特性
猜你喜欢
![pytorch_lightning.utilities.exceptions.MisconfigurationException: You requested GPUs: [1] But...](/img/b4/8921c3ca5cd5a547768489d4a79202.png)
pytorch_lightning.utilities.exceptions.MisconfigurationException: You requested GPUs: [1] But...

Adobe Premiere foundation - sound adjustment (volume correction, noise reduction, telephone tone, pitch shifter, parameter equalizer) (XVIII)

评价——秩和比综合评价

766. 托普利茨矩阵

Cesium 多边形(polygon)extrudedHeight 和 height 的区别

数据库查询优化:主从读写分离及常见问题

The practice of dual process guard and keeping alive in IM instant messaging development

【ELT.ZIP】OpenHarmony啃论文俱乐部—数据密集型应用内存压缩

药物发现综述-03-分子设计与优化

LMSOC:一种对社会敏感的预训练方法
随机推荐
如何高效读书学习
将某数据库N多表名作为另外一张表中某一列得值(范围可以是别的数据库中得某张表)
Capacitor
Numpy----np. Tile() function parsing
frp实现内网穿透
Class initialization and callback usage
面试官问:能否模拟实现JS的new操作符
Is it safe to open an online futures account?
Intensive reading of transformer thesis paragraph by paragraph
外盘期货哪里可以开户?哪个平台出入金比较安全?
【sylixos】i2c设备驱动创建和使用
ionic4实现半星评分
对比学习中的4种经典训练模式
【sylixos】NEW_1 型字符驱动示例
TI AM3352/54/59 工业核心板硬件说明书
【永艺XY椅】试用体验
嵌入式必学!硬件资源接口详解——基于ARM AM335X开发板 (下)
Jenkins - 访问 Jenkins 自定义参数变量,处理变量值中含有空格
声网 VQA:将实时互动中未知的视频画质用户主观体验变可知
Evaluation - rank sum ratio comprehensive evaluation