Need help to configure jenkins to send report links on mail - email

I am using Jenkins to trigger my build., Jenkins is hosted on AmazonEC2. The complete build process is mentioned below:
1. Jenkins checkouts the latest build from GiTHub.
2. Jenkins run the complete build & I am getting Build Success Message.
3. After the process is completed jenkins creates some HTML reports in the jenkins user on Amazon EC2.
Now I need to send that particular report link in mail, how would I do that? Is there any plugins available by which I can manage all the reports generated for a single day and can keep the reports of last 15 builds or something.
What I can think of is, whenever a build completes, there should be a process or shell script should run which will copy the reports from jenkins user to some apache available sites and then that report can be sent on email.
please let me know, If I am thinking in the right direction or there is any other way to do the same?
Any help would be appreciated.

You can use Jenkins plugin "Email-ext plugin" to send emails.
If you can get the report into your workspace. then, you can
write a mime message something like this in the plugin.
msg.setSubject("Mail Subject");
def reportPath = build.getWorkspace().child("report.html")
msg.setContent(reportPath.readToString(), "text/html; charset=utf-8");

Related

Send build artifacts in an email via TeamCity

Is there any way of sending TeamCity build artifacts which include execution report (*.html) via email when the build is successfully executed?
Thanks in Advance.
Unfortunately it's not possible to send any attachments - you can vote for this issue TW-7318
However you can list/link to the build artifacts but this is also not fully recommended. See the TeamCity Docs

vsts detailed notification after build or test fail

I am trying to make vsts email me with a detailed transcript of why a test or build fails. At the moment all I am getting is te following email:
All this mail tells me that a test has failed but not what test or what the problem is. It does give me a link to open the build report in web access which has all the information about the type of error and even the stacktrace.
Is there a way to get this detailed information (error message and stack trace) into the email or can i make vsts send a custom email with this information?
It seems you are using VSTS default notification template (as a build fails template).
For now, there is no way to custom the notification template. And there has an user voice Customise VSTS email templates which suggest this feature. You can vote and follow up.
The workarounds for now as below:
Option 1: Click the link "Open Build Report in Web Access" for detail build logs.
Option 2: Add Send Email task at the end of your build definition, and select "Only when a previous task has failed" for run this task option, so that email will be sent if the build fails. And you can custom the email body as your need.

Fail/pass Jenkins job by email notification

We have an in-company system for creating production builds, and I need to create a Jenkins job to automate those builds.
There is a way to automate the launch of production build. But you can only know the results of the build by an email notification. Furthermore, you can only subscribe to notification using your personal domain credentials, i.e. the same login/pass that you use to log into your computer (and the password changes every month).
So now, Jenkins job is considered "pass" as soon as the build launches, and not when it actually finishes.
I wonder how to make Jenkins pass/fail the job with the given restrictions.
Additionally, I want to avoid:
hardcoding my personal credentials anywhere,
depending on my or anyone else's personal computer being turned on.
Ideas?
I'm not aware of any Jenkins plugin that is capable of receiving e-mails.
If you can manage to store the notifications' content in a file you could use the
Text-finder Plugin in the Post-build Actions of an additional monitor job that runs on a regular basis.
Have a look at Monitoring external jobs, too, whether this is useful for you.
UPDATE:
There is actually a plugin that receives e-mails: the poll-mailbox-trigger-plugin. Install it and do the following:
Create a new Freestyle project named e.g. Build Status Mail Monitor
Build Triggers → [✔] [Poll Mailbox Trigger] - Poll an email inbox
configure as desired
Build → Add build step → Execute Groovy script
◉ Groovy command: add code to change build launcher job's status

how to send email notification to developer for build failure in Jenkins

I have a continuous integration setup and integrated selenium scripts in jenkins. In case of failure in build, mail notifications should be sent to the developer who commited the changes. I run selenium scripts in jenkins to verify the status of the build. The problem is that if there is any failure, email notifications are sent to the selenium script developer instead of the application developer. It assumes that build is getting failed due to the changes made in selenium script but the actual issue is with the application code.
Is there any way to send mail to application developers for build failure instead of selenium script developer ?
I would have preferred to write this response as comment rather than answer, but due to insufficient rep, am posting it anyways.
If you want to send email notifications to particular email address, check out Email-ext plugin. With this you can add post build action of Editable Email Notifications and control which email address you send notifications and when(if your job fails or success)
First of all, use email-ext plugin as mentioned above. Secondly, ensure you select 'upstream committers' option. As per its own description: "Sends email to the list of users who committed changes in upstream builds that triggered this build." If your application build triggers a selenium build, this is what you need.

Trigger Build in Jenkins By EMAIL

I am Currently using Jenkins in Windows 7 .
I have recently ran some build in jenkins . I am Able to run the build by SVN Post commit .
Now i have to triiger the build in Jenkins by email.
I am a windows user and as per my knowledge Sendmail and qmail agents have to be used to trigger build in jenkins by email.But these are for Unix .
Or is there any way i can install sendmail on my windows machine and then perform the trigger.
I am A windows user and so if any plugin is there to trigger builds in jenkins .Please let me know.
thank you
Use a simple free mail client (say, Mozilla Thunderbird) that would filter trigger e-mails in the appropriate folder. Monitor the file system location of that folder with FSTrigger Plugin.
You do not need to read the e-mails in the folder. What you do is this: for each build create an e-mail folder, create a filter that sorts e-mails by subject (subjects would be something like "Trigger [job-name]" ). And monitor modifications to those folders via the plugin. My Thunderbird folders, for example, are stored locally in C:/Users/[user_name]/AppData/Roaming/Thunderbird/Profiles/9nby4v95.default/Mail/Local Folders/ But you can configure Thunderbird to put them wherever you want.
I wrote the following Jenkins plugin about 3 months ago, to do just this:
https://wiki.jenkins-ci.org/display/JENKINS/poll-mailbox-trigger-plugin
https://wiki.jenkins-ci.org/display/JENKINS/Poll+Mailbox+Trigger+Plugin.
Check it out, read the documentation, let me know if this solves your problem.
All documentation is on gitHub now:
https://github.com/jenkinsci/poll-mailbox-trigger-plugin