I found the reason. The html is in the salve's workspace not in master's workspace. So jenkins cannot find it. When I restrict it run on slave, the problem is resolved.
How can I attach a file to the email in Jenkins?
-
30-06-2023 - |
Question
I have a problem now with Jenkins Email. I tried to attach a file like demo.html in the $WORKSPACE. But it didn't work. I just received an email with build.log attached. Could someone figure out what's the problem?
I am now doubting that the email is processing in Jenkins master, and my job is working in slave. Is that the reason?
Here is Attachments filed in Editable Email Notification. I filled it with "*.html"
============
Attachments *.html
============
I also tried ./*.html in Attachments field, but with no luck.
A part of build log:
completed with result SUCCESS
Checking if email needs to be generated
Email was triggered for: Success
Sending email for trigger: Success
NOT overriding default server settings, using Mailer to create session
messageContentType = text/plain; charset=UTF-8
Request made to attach build log
Adding recipients from recipient list
Adding developers
Successfully created MimeMessage
Sending email to: test999922@hotmail.com
Finished: SUCCESS
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow