After completion based on continuous integration deployment jenkins, the task of building a complete implementation of the test results need to be notified to the relevant personnel. This blog describes how to configure e-mail notification method in the jenkins. . .
First, install the plug-Mail
Because Jenkins comes mail function relatively tasteless, so here is recommended to install a special plug-in e-mail, but also passing below describes how to configure Jenkins mail function built-in role.
Management system can manage widget → → Alternatively widget, selecting Email Extension Plugin plug installation:
Since I already have the plugin installed, so here is displayed in the directory where you have installed, not yet installed the plug-in children's shoes can change the search through the search box in the upper right corner, then online, the installation after the restart Jenkins good.
Second, the system settings
→ management system by system settings, mail configuration:
1. Set jenkins address and administrator email address
2, the sender and other information provided
PS: The sender's e-mail address here and remember to system administrators e-mail addresses remain the same (of course, you can also set up a dedicated mail sender, but does not affect the use, can be set depending on the circumstances)
The figure is more than the default recipient mailboxes can be added, separated by commas can be in English.
3, configure the mail content templates
Report: E-mail content templates (Default Content):
4, set up a mail trigger mechanism
After completion of the above steps, click Apply, and save it.
5, built-in mail function to configure Jenkins
Configuration as follows, and Email Extension Plugin plug-in the same configuration, you can check by sending a test message test configuration to test whether the configuration to send the message, as shown below button:
After completion of the above system settings, click Save.
Third, the project configuration
After completing the system settings, also need to configure e-mail to the project needs to be built.
1, into the project configuration interface
The new interface into the project, click on the Configure button to enter the system configuration page:
2, after the operating configuration build module
After entering the System Configuration page, click on the top of the building after the operation option, configure as follows:
进入构建后操作的模块,然后会看到下面的内容,具体的配置信息如图中标注:
接上图:
配置内容默认即可,邮件内容类型可以根据自己的配置选择,收件人列表可以从前面的系统设置中默认收件人选项配置。
四、构建触发邮件测试
如下图,为我收到的测试邮件,邮件内容可以通过系统设置里面进行个性化的配置,可参考我上面的模板,或者自定义即可。
以上内容,即Jenkins配置自动发送邮件的方法,仅供参考。。。