to send xml files as an attachment with notification email in hudson
avneet kumar
Greenhorn
Joined: Jun 01, 2011
Posts: 7
posted
0
Hi,
I have a configured a project in hudson which is generating certain xml files after its execution.I want to attach those file with the notification email being sent after the project's execution.I have installed email-ext plugin but no such option is there.
email-ext wrote:To see a list of all available email tokens and what they display, you can click the "?" (question mark) associated with the Content Token Reference at the top bottom of the email-ext section on the project configuration screen.
Then following this step, you will see a number of tokens you can insert, including:
email-ext wrote:${FILE, path} - Includes the content of a specified file.
path - The path to the file. Relative to the workspace root.
I will try to implement this & will let you know the results
avneet kumar
Greenhorn
Joined: Jun 01, 2011
Posts: 7
posted
0
Hi Peter,
Can you please throw some light on how to setup this token & its corresponding value in project configuration in hudson.
I am facing some problem on setting up this
What have you tired so far and what has the result been?
avneet kumar
Greenhorn
Joined: Jun 01, 2011
Posts: 7
posted
0
Hi Peter,
Is it possible to send a file as an attachment with the Hudson mail notification.
We are trying it with email-ext plugin but the attachment is not coming with the mail, It is simply send the defined parameters as a message in the mail.
Exactly where is index.html located? Is it within your project? Is it located somewhere on the Hudson server? Is it located somewhere on the build slave?
avneet kumar
Greenhorn
Joined: Jun 01, 2011
Posts: 7
posted
0
This index.html is located in the workspace of hudson...I am just executing simple scenario with hudson only as master...no slave is there....
& this workspace is in the VM machine where hudson is.Here is the path: /root/.hudson/jobs/test/workspace
Mahendra Singh India
Greenhorn
Joined: Aug 16, 2011
Posts: 3
posted
0
Please suggest me how to use FILE token. I am specifying as what is mentioned in previous post.
my file is present under workspace
I am using :${FILE="pom.xml", path="file path"}.
Its not working. Please suggest on with an example
There is this phrase in the help text regarding the path: "Relative to the workspace root." So the question becomes, what is "the workspace root?" Well, looking at the ~/.hudson/jobs directory, I noticed that for job Foo Bar, there was this directory structure:
~/.hudson/jobs/Foo Bar/workspace/foobar
That last foobar is the project directory from Subversion, and it is that foobar directory that contains my project (that it the Mavne or Ant build script resides there and it is basedir for the builds. However, foobar is not "the workspace root." Instead, the workspace directory is the workspace root.
The other thing I had to figure out is that the syntax for the properties is not well documented. It should really say:
${FILE, path="xxx"} where xxx is the relative path to the file
Thus this worked for me:
${FILE, path="foobar/pom.xml"}
I received an email with the contents of the POM.
Mahendra Singh India
Greenhorn
Joined: Aug 16, 2011
Posts: 3
posted
0
Hi Peter,
Thanks for the configuration suggested.
It is working fine for me as well.
I am also getting the file as the content. Is there any option by which we can get the file as an attachment.