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]
3. Select [Add Robot]
4. Select Custom (access custom service through webhook)
5. Complete adding the robot
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.
2. Enter the Jenkins system management page
3. Find the [DingTalk] configuration item and configure it as follows
4. After the configuration is completed, you can test it
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
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
Finally, we can see the message notification in DingTalk:
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:
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!