retrospectively switch on emails for Jenkins jobs - jenkins

We have a Jenkins instance with over 250 jobs installed in it. Until recently corporate rules prevented us from configuring Jenkins to send emails for build failures etc.
We have now been given permission to configure Jenkins to connect to the corporate SMTP server and I have configured one job to send emails and all is working fine. Is there an automated way to enable emails for all jobs or do I have to go into the configuration for each job and manually enable it?
If not are there any plugins or shell scripts?

Configuration Slicing plugin (https://wiki.jenkins-ci.org/display/JENKINS/Configuration+Slicing+Plugin) can help in this situation.
Install this plugin, then go to Manage Jenkins -> Configuration Slicing -> E-mail Notification
Put email into the left column, all job names to the right column, then press Save.
Please note that it will change each job configuration and add E-mail publisher to them.

Related

Email no longer sent after jenkins job execution

On a Ubuntu, I have a Jenkins service setup with Email-EXT plugin, where I have setup jobs executed regularly, and emails are being sent after the job execution. But just recently, I no longer receive any emails after the job execution.
Details:
In each job execution "console output", it is said that Email has been triggered.
And I was able to use the "Test configuration by sending test e-mail"
on Jenkins/"configure system" page" to send out the testing email.
Based on my company rule, I had the password changed just recently.
And I did the some update on jenkins/configure page as well.
jenkins version 2.176.1
EMAIL-EXT plugin version: 2.69
So what could be wrong for not receiving emails ????
In my case, there is nothing wrong with the jenkins side settings. I have switched the smtp server to user the gmail one, and it works. It must be some policy change on my company smtp server side.
BTW, to turn on the debug mode of the trigger gives some direction to my case.

Why does Jenkins always access the AD server mail group during the build job?

I use Jenkins ldaps configured by my OA account, and all functions are well. But my MIS colleague told me that during my colleague build the job, my OA account always accessed the LDAPs server mail group.
Can someone give me some advice? Thanks
I can only guess, that Jenkins is trying get infos for the user triggering the build. Commonly this is used to send a mail to the user, who broke the build.
You can turn off this behavior under Jenkins -> Configure Jenkins -> Global Security -> LDAP -> "Disable Ldap Email Resolver". You can also try to enable the cache on the same page, which will reduce the queries made to your Active Directory/LDAP.

Jenkins e-mail notification only for first failing commit

For my Jenkins job I would like to have Jenkins send e-mails under two conditions:
The build was fine before, but now it fails.
The build failed before, but now it is fine.
I do not want it to send e-mails for any additional failing builds between (1) and (2).
I would have expected that having the setting "Send e-mail for every unstable build" unchecked would prevent just that, but I receive e-mail for every single failed build.
How can I achieve my desired behavior? Is this a bug in Jenkins (2.121.2) or the Mailer plugin (1.21)?
There is a better plugin for sending emails on certain conditions on Jenkins plugin site: https://wiki.jenkins.io/display/JENKINS/Email-ext+plugin
Try finding Editable email in post-build actions or install it via Jenkins manage plugins options.
Below is a screenshot which is part of the Editable Email notification post-build task:

Jenkins 2.3.5 Build Notification (Emailext, bitbucket build status notifier) Not Working

We recently rebuilt our Jenkins server and we are using Jenkins 2.3.5/JDK8/ubuntu 14.04/bitbucket cloud/hipchat cloud.
After we got the newly built Jenkins server running, everything worked except for the build result notification.
We used to get the bitbucket account that we used with Jenkins to comment on the build result, so we can receive it in the hipchat room, even without using hipchat notification plugin. Now, we have tried the emailext plugin, Bitbucket Build Status Notifier Plugin, but none of them worked. It seems that the plugin is all out of date in terms of configurations.
For emailext, it complains "An attempt to send an e-mail to empty list of recipients, ignored." But we put a number of email in the "Default Recipients". And all the SMTP settings are correct since we can receive testing message.
For Bitbucket Build Status Notifier Plugin, I followed here, but I couldn't find the "Bitbucket notify build status" in the job configure.
Any suggestions would be appreciated.
Use Extended Email notification plugin, set SMTP server in Jenkins global configuration

Jenkins- Create Jobs on different servers

I want to configure Jenkins to build my code on 1 server. Then want to deploy it on another server using Jenkins.Both servers are using Linux I want to automate the entire process as much as possible. I went through some of plugins like pipeline, Job Import Plugin, etc
Can anyone guide me how to go about it ? Which plugins will be useful ? Any example or tutorial somewhere will be useful. The configuration of build pipeline plugin on jenkins was not seamless for me.
Thanks,
Bhargav
I would work it this way :
Install jenkins on your first server
Install the following plugins : ssh credentials, ssh slaves, copy to
slave, and restart jenkins
Go to Manage jenkins -> Manage credentials, and add ssh credentials
for your second server
Go to Manage jenkins -> Manage nodes, and create a passive slave.
The launch method should be "Launch slave agents on Unix machines
via ssh". You should use the credentials that you have added in step
3
Create a job to build your code. In the advanded options of job, you
should indicate that the job must only be built on master node.
Create a job to deploy your code on the second server. In the
avanded options of job, you should indicate that the job must only
be built on slave node.
In the "Build Environment" section, check the "Copy files into workspace before building" box and configure what files you want to copy from first server (https://wiki.jenkins-ci.org/display/JENKINS/Copy+To+Slave+Plugin)
The code will be copied into the jenkins slave's workspace.

Resources