Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to attach files to Jenkins Pipeline notification

I am trying in a pipeline to attach files to my notification mails.

How can I do that? An example would be nice.

like image 352
eran meiri Avatar asked Jan 02 '17 06:01

eran meiri


People also ask

How do I add an attachment in Jenkins?

Simple answer: Copy your file into the workspace(into your job directory), then under Attachment, just give the file name without any quotation or anything. This will automatically tell Jenkins to pick up your file. That's it!

How do I use editable email notifications in Jenkins?

For a project to use this plugin, you need to enable it in the project configuration page. In the Post-build Actions section, click on Add post-build action and then select Editable Email Notification. There are three main fields that you can edit when this plugin is enabled: Project Recipient List.

How do I add an email recipient in Jenkins?

Enter the recipient email id in the 'E-mail Notification' box and select the checkbox next to the 'Send e-mail for every unstable build' option. Click the 'Advance Settings…' button in the 'Editable Email Notification' box. Click the 'Add Trigger' drop-down and select the 'Always' option and Click the 'Save' button.


1 Answers

email-ext uses Ant File Syntax

As for example usage:

emailext attachmentsPattern: '**/report.html', body: 'Find attachments', subject: 'test', to: '[email protected]'
like image 86
hakamairi Avatar answered Sep 20 '22 11:09

hakamairi