Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attachment using Editable Email Extension in Jenkins

I am using Editable Email plugin in Jenkins to attach a file with the email. The problem is that the plugin is unable to find the file to attach.

My file structure is like this -
ReportDirectory
workspace

ReportDirectory contains the report which I want to attach. I believe that the base directory for the plugin is the workspace. So I am giving the attachment location as ../ReportDirectory/DemoReport.html. I have also tried ReportDirectory/DemoReport.html

and many more options. Am I doing something wrong?

like image 443
Kumar Vaibhav Avatar asked Dec 18 '12 03:12

Kumar Vaibhav


1 Answers

I figured it out.

The Editable Email plugin uses the Ant File Syntax for locating the attachment. When I took at the documentation for Ant File Syntax ( http://ant.apache.org/manual/dirtasks.html ), it says that

In general, patterns are considered relative paths, relative to a task dependent base directory (the dir attribute in the case of ). Only files found below that base directory are considered. So while a pattern like ../foo.java is possible, it will not match anything when applied since the base directory's parent is never scanned for files.

Since the base directory in this case is the "workspace" and my directory "ReportDirectory" is not located in it so the Ant is not able to access it.

Two solutions exist:

  1. Move the "Report Directory" somewhere in "workspace". I did not prefer this because I did not want to mess up the workspace.
  2. Once the report has been created in "ReportDirectory", use your Ant\MSBuild script to copy it temporarily in the "workspace" and then the Email plugin shall be able to access it by something like **/Report.html or something.

@Amey - thanks for your efforts though :)

like image 59
Kumar Vaibhav Avatar answered Oct 11 '22 14:10

Kumar Vaibhav