After you complete the continuous integration deployment based on Jenkins, the task build is completed and the test results are notified to the relevant person. This blog, describes how to configure the method of email notification in Jenkins ...
First, install the Mail plugin
Since Jenkins comes with a junk mail function, it is recommended to install a special mail plugin, but the following will also be incidentally described how to configure the function of the message Jenkins comes with.
Can be installed through system management → management plug-in → optional plugin, choose Email Extension Plugin plugin:
Since I have installed the plugin, it is shown here in the installed directory, the children's shoes that have not yet been installed can be searched by the search box in the upper right corner, then installed online and restarted Jenkins after installation.
Second, system settings
Through system management → system settings, to configure the mail:
1. Set Jenkins Address and admin email address
2. Set the sender and other information
PS: Here's the sender's email address remember to be consistent with the system administrator e-mail address (of course, you can also set up a special sender mailbox, but do not affect the use, depending on the situation set)
The default recipient mailbox can be added to multiple people, in the middle of a comma separated by a half-width.
3. Configure the message content template
Attached: Mailbox content template (Default content):
<! DOCTYPE html> 4, set the message trigger mechanism
Once the above steps are complete, click Apply and save.
5. Configure the Mail function with Jenkins
The configuration is as follows, and the same configuration as the email Extension plugin plugin can be checked by checking the send test mail test configuration button to test whether the configuration sent the message successfully, such as:
Once you have completed the above system settings, click Save.
Third, the project configuration
After you complete the system setup, you also need to configure the items that need to be built.
1. Enter the project configuration interface
Enter the new project interface and click the Configure button to enter the System configuration page:
2. Configure the post-build Operation module
After entering the System configuration page, click on the post-Build Action option above to configure the following:
Enter the module of the post-build operation, and you will see the following content, which is indicated in the specific configuration information:
Pick up:
Configure content By default, the message content type can be selected according to its own configuration, and the recipient list can be configured from the default recipient options in the previous system settings.
IV. Building Trigger Message Testing
For example, for the test mail I received, the contents of the message can be configured through the system settings, can refer to my template above, or customize.
The above content, that is, Jenkins configuration automatically send mail method, for reference only ...
Original: https://www.cnblogs.com/imyalost/p/8781759.html
Jenkins Configure email notifications