Can Jenkins also support DingTalk message notifications? A plug-in will help you do it!

As the most popular open source continuous integration platform, Jenkins has always been favored by testers and developers for its powerful expansion capabilities. Everyone knows that we can install the Email plug-in in Jenkins to support timely notification of the results to relevant personnel via email after the build.

But in fact, Jenkins can also support DingTalk message notifications, which are mainly implemented through the DingTalk plug-in. Attached at the end of the article: DingTalk official website link.

1. Configure DingTalk webhook

1. Create a group chat on DingTalk PC

2. Click Settings in the upper right corner of the group and click [Smart Group Assistant]

picture

3. Select [Add Robot]

Insert image description here

4. Select Custom (access custom service through webhook)

Insert image description here

5. Complete adding the robot

Insert image description here

Insert image description here

2. Install and configure the DingTalk plug-in in Jenkins

Here takes Jenkins V2.264 as an example:

1. Go to the Jenkins plug-in download page, search and download the DingTalk plug-in, and remember to restart Jenkins after installing the plug-in.

picture

2. Enter the Jenkins system management page

Insert image description here

3. Find the [DingTalk] configuration item and configure it as follows

Insert image description here

4. After the configuration is completed, you can test it

picture

Configure DingTalk notifications in Job

前面一系列准备工作完毕后,我们可以新建任务/选择已有的任务添加钉钉通知。

What needs special attention here is: DingTalk does not support Maven style tasks, so we need to choose free style for the tasks here.
Find the [DingTalk Robot] configuration item in General and refer to the following configuration

Insert image description here

The custom content (message notification content) supports Markdown syntax, and the content is as follows

  • Build number: ${BUILD_NUMBER}
  • Test report: ${BUILD_URL}allure
  • Build log address: ${BUILD_URL}console

If the code itself is a maven project type, we can choose to execute it like this: Select to execute the windows batch command in the Build item, and fill in the command: mvn clean test

picture
Finally, we can see the message notification in DingTalk:

picture

Finally, I would like to thank everyone who reads my article carefully. Reciprocity is always necessary. Although it is not a very valuable thing, if you can use it, you can take it directly:

Insert image description here

This information should be the most comprehensive and complete preparation warehouse for [software testing] friends. This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey. I hope it can also help you!      

Guess you like

Origin blog.csdn.net/qq_48811377/article/details/133097870