We use Jenkins as a CI platform. We have integrated it with GitHub, so that whenever I open a PR I can see at the bottom whether a build is running (yellow circle), succeeded (green tick) or failed (red cross). The thing is - the build lasts very long and I have to constantly open the PR and look at the status. I was wondering whether:
1) It is possible, that Jenkins sends an email, when a particular build finishes (but I want to get emails only for builds of my pull requests, not for everybody's PRs)?
2) Maybe the Jenkins bot can write a comment in the PR, which in turn will notify me via GitHub notifications?
Can anybody point me to a resource about how this can be setup?
Select “Add post-build action” and Click “E-Mail Notification”. Enter your recipients mail address and select first option “Send e-mail for every unstable build”. Click “Save” button.
Go to the Jenkins home page and click the 'Manage Jenkins' menu option. Then, select the 'Configure System' option. Enter the SMTP server name under 'Email Notification'. Click the 'Advanced' button and then click the checkbox next to the 'Use SMTP Authentication' option.
Jenkins comes with an out of box facility to add an email notification for a build project. Step 1 − Configuring an SMTP server. Goto Manage Jenkins → Configure System. Go to the E-mail notification section and enter the required SMTP server and user email-suffix details.
If your build is caused by PR on Github, I would advice you to combine 2 things
Also, in case if you will not be able to extract PR author details from build trigger info, consider using https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin , where Lookup PR detailed information for each PR is supported for sure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With