0
votes

I want to mail the below file through Jenkins(include newlines).

$ cat summary.txt

---| My First test |---

Total Tests: 1

Total Passes: 0

Total Errors: 0

Total Failures: 1

Total Skipped tests: 0

Jenkins job configuration:

Inject environment variables:

Properties File Path
/path/summary.txt

Editable Email Notification:

Default content: $DEFAULT_CONTENT ${FILE, path="summary.txt"}

Received Mail:

First - Build # 111 - Still Failing: Check console output at http://1.1.1.1:8080/job/First/11/ to view the results. ---| My First test |--- Total Tests: 1 Total Passes: Total Errors: 0 Total Failures: 1 Total Skipped tests:

Expected Mail:

First - Build # 111 - Still Failing: Check console output at http://1.1.1.1:8080/job/First/111/ to view the results.

---| My First test |---

Total Tests: 1

Total Passes: 0

Total Errors: 0

Total Failures: 1

Total Skipped tests: 0

1
are you using email external plugin or you are sending mail through what? - SV Madhava Reddy
Using Email-ext plugin. - Eswari Muthusamy
instead of doing like that, you can attach the build log to the email. Because sometimes log may be of too much size. - SV Madhava Reddy
Yes, this(build_log) would be more helpful. Thanks :-) - Eswari Muthusamy
Is that what you want? - SV Madhava Reddy

1 Answers

0
votes

If your build log is too long, putting all the content in the body might not be good and cumbersome too. So instead of that, please make it as an attachment to the email. So that Long content, format issues etc issues will be gone. You can do that in the script by this(build_log) calling this. Hope this is helps.