Email Reports through Jenkins - jenkins

I have a pdf generated by Dynamic Reports.I want to add this pdf as an attachment in the mail feature of Jenkins for each and every build of the project.Is It possible to achieve this.Is there any another way in which I can mail my reports through Jenkins.

Use Email-ext plugin for Jenkins. It provides more configuration options than "standard Jenkins" emails. Also it gives you opportunity add attachments to your emails:
Attachments
New to version 2.15 is the ability to add attachments using the Ant pattern matching syntax used in many places in Jenkins. You can set a maximum total attachment size in the global configuration page, or it will be unlimited.

Related

how to use emailext-template in jenkins pipeline to get the template?

There is a good plugin, emailext-template. Basically, I do not have the access to Jenkins-server. It is not convenient to choose the option mentioned in emailext to create the email template.
I dont know how to use this emailext-template plugin to get the template in jenkins-pipeline. There is no guideline in emailext-template. Any documents?
// expected usage in jenkins-pipeline
template_str = emailext-template('template-id')
This can be done in the following way, In case you can deploy jenkins again (if it is done on the cloud), you could create and deploy your email template as part of jenkins installation and configuration.
In case you did not have access to the jenkins server even while deployment, you can just form the html template with the corresponding variables and then use them in the job configuration itself.
The below image shows how the template files are used in jenkins, Instead of the script tag as in the image, you can replace with your own html content so that jenkins will be able to send email with that content.

Send Job changes over email

I can see in job page it shows the stories,bug fixes etc in changes tab. Is there a way to extract them and sen over email for each job?
You can use the email-ext-plugin. It has the most customisation possibilities
of the mail plugins as far as I know, but it will require you to write some scripts.
If you go to Add Post Build Action and select Editable Email Notification, you will be able to configure the content of the email in details.
The default content can be configured in the advanced tab. You'll have to create a Groovy script to retrieve the information you want to put in the email. Groovy scripts are powerful in that you can hook into the Jenkins API itself to get any information you want or need. For more details refer to the doc of the plugin.
There are various templates to retrieve commonly used fields such as Changes. If the fields you want to extract are parts of external plugins, there is probably no example for them but they are available to Jenkins' Groovy as well.

Is there any plugin to show the results(.xls file) in pipeline job in Jenkins?

I have a requirement to show the xls file in the pipeline job of jenkins.Is there any plug-in which met my requirement.
No, there is no public Jenkins plugin that shows the results of a .xls file.
As previously suggested on the jenkinsci-users mailing list, you could perhaps convert the file to CSV first and use the Plot plugin, depending on the type of data you have.

collate Jenkins build artifacts to make another html report

I have approx 50 Jenkins job running HP Performance center script twice a day, which archives Performance center report that it gets from remote PC server. I am able to send these individual reports on emails but I would like to consolidate all these reports. Getting the status of these tests by reading html would be a better option. Is there a way I can achieve this
http://localhost:8080/job/Test_Sanity/job/Test_Sanity/38//artifact/performanceTestsReports/pcRun106540/Report.html
You might have to zip the reports manually and use extended email plugin to attach the same.
(Note: Extended email plugin can attach only with in the workspace , so you might have to move your zip file to workspace)

Jenkins Email-ext plugin - tokens

Hi I'm using Jenkins Email-ext plugin.
Where can I find a list of all the things I can refer to in the html content of the email?
For instance: I recently found out that you can put parameters values inside the mail using:
${ENV,var="variable_name"}
But say that I want to get build log or build number or build status (passed fail).
Do you know if there is a document listing all data that is referable in this plugin.
Thanks!!
On job configurations page:
Check 'Editable Email Notification' box -> find 'Content Token Reference' (it's between 'Attachments' and 'Trigger for matrix projects') -> Click on ? to the right side of it.

Resources