Is there a way to inform users about a change in Stash repository? - jenkins

I would like to know if it is possible to send an e-mail notification to certain users when there is a modification to a particular directory within a repository in Stash. I know it is possible to write a shell script within Jenkins project to do this and then inform through e-mail but I would like to know if there is a native option within Jenkins configuration to this action.

This is possible within BitBucket Server itself as of May 7, 2013:
Repository subscriptions
[...] At times, you may want to receive emails on specific types of messages you care most about including:
...
Commits – when a new commit is added or a comment is left
...
See also Manage Inbox and email notifications.

You can use Poll SCM under Build Triggers section.
Define a job that uses GIT plugin, specify a workspace and machine so it'll always be synced with the latest, and poll every 2 minutes. if there is a change in the repository the job will be triggered. Add a post build action to send emails using the built in email notification or using Email-ext plugin.
Don't forget to edit the SMTP information under Manage Jenkins->Configure.
You can check Here for more information about Jenkins Polling.

Related

Jenkins: no email to recipients (integration with GitLab)

I'm using Jenkins (with Email Extension plugin ... ), integrated with GitLab.
For my job in my post build actions configuration, I see this (note that the recipients list is empty ...)
When the job fails I see this in the console output
15:29:50 New run name is '#25'
15:29:51 Sending e-mails to: name1.surname1#mydomain.com name2.surname2#mydomain.com
name3.surname3#mydomain.com
and emails are sent.
Where are these names found/are coming?
Any suggestion will be appreciated.
Your E-mail Notification is configured with the Send separate e-mails to individuals who broke the build option enabled. This makes the Mailer Plugin send a notification to each e-mail address involved in committing Changes for the build in case the build failed.
Changes and their authors are shown at each job page.
For example, there are 4 Git commits from 4 different authors (identified by email). Those commits gets pushed to the Git server and Jenkins job gets started. The job picks all those new commits and fails. The plugin then picks all distinct emails from the commits and sends an email to each commit author assuming at least one of them broke the build.

Jenkins Email notification for multiple builds

I need suggestion for Jenkins project (multi-conf or pipeline) and plugins that will fit my work.
I have 10 "flavors" of the product, so I must build 10 times every time I commit to the repository (all in the same workspace, run in sequentially). Today I have 10 jobs (freestyle) and a "master" job that trigger the rest. I tried to add Email notification (using Email Extension Plugin) but I want only one Email report for all the builds, not 10 Emails.
I understand that I should change to one multi-configuration project or one pipeline project that will handle all the builds, so it will be easier to trigger only one Email, but what is the best practice to get only one Email report on multiple builds?
This is the exact scenario which we can achieve using Pipeline job(Jenkinsfile) from which you can trigger all those freeStyle build-jobs in parallel and collect the build-url and build-status of those and store in some file, then use the email plugin in the post-build task to send the status of your complete flow.
You can use the following link to find how to access build variable post calling that inside your pipeline.
How to I get the url of build triggered with build step on Jenkins?

How to combine multiple build started Jenkins messages into one email

I am using Jenkins, Gerrit and repo for my project. Often times I make code changes that span across git repositories (all managed through repo). When I submit a CL it triggers multiple Jenkins jobs (pre-submits, cross reference checks, linters...) which sends flurry of build started emails and finally one email with +/-verified status. Wondering if it is possible to combine all the build started emails into one (just like the final verified status email)
I would suggest you to use Pipeline where only one job will be triggered as part of Gerrit trigger and the Pipeline will take care of calling all other jobs and update the Gerrit with the final message.

Jenkins Global Email Notification Setting

I have a Jenkins configuration with ~100 jobs. Whenever any of those jobs fails I want an email notification to be sent to a particular email address. How can I do this without adding a post-build action for every individual job?
There is something like Configuration Slicing Plugin https://wiki.jenkins.io/display/JENKINS/Configuration+Slicing+Plugin. It enables global configuration different aspects

Build Jenkins project on BitBucket pushes and pull requests

I have a scenario where I'm setting up Jenkins for my app. I have BitBucket set up and firing appropriate webhooks.
I want to start a build whenever a push is made to the repo as well as whenever someone creates/updates a pull request.
I've looked at the BitBucket Plugin. It works good if I have the BitBucket webhook to fire for all pushes.
Then I added the BitBucket Pull request plugin to build on every pull request create/update. So I changed the BitBucket webhook preferences to fire on pushes and PR creates/updates.
Unfortunately, these plugins have conflicting settings, hence they cannot be used at the same time (as per my research, the minute I send custom webhooks from BitBucket, the first one stops working, but the second one works)
Has anyone been able to set this up correctly? Maybe there's a plugin for what I want, but I couldn't find it.
I want to keep writing a proxy in front of Jenkins to manage webhooks the last option, only if there really is nothing I can do.
Thanks for the help!

Resources