how to trigger for every build in Jenkins?

by (552 points)
0 votes
I just installed Jenkins. I have all default plugins installed. I even configured the SMTP credentials and tried sending a test mail. All works fine now.

Now in post build step, I have an option to send an email. But, I can send email only when the build is failed or the build is back to normal. It does not have an option to allow me to send an email when build passes.

Kindly advise.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

2 Answers

answered by (151 points)
selected by
+1 vote
Best answer

It looks like you are using "E-mail Notification" option during post build step.

Follow below steps.

  • Click “Add post-build action”
  • Click “Editable Email Notification”
  • Click “Advanced Settings…”
  • Click “Add Trigger”
  • Click “Always”
  • Save

It should help.

answered by (570 points)
edited by
0 votes

To trigger a Jenkinks job for every build, test automation services uses below mentioned steps:

In the job configuration of Jenkins job, test automation services can define various build triggers. For periodical build, test automation services can schedule the build by defining the date or day of the week and time to execute the build.

Below is the format:

MINUTE (0-59), HOUR (0-23), DAY (1-31), MONTH (1-12), DAY OF THE WEEK (0-6)

1. Select 'Build Periodically' option under 'Build Tigger' section of a Jenkins job and apply below mentioned data as per the requirement:

a.) Start build daily at a particular time (say 08 in the morning, Monday - Friday):

H 08 * * 1-5

b.) Daily build twice a day (say 12:00  and midnight 00:00, Sunday to Thursday):

H 0,12 * * 0-4

c.) Start build daily in the late afternoon between 4:00 p.m. - 4:59 p.m. or 16:00 -16:59 depending on the projects hash:

H 16 * * 1-5

d.) Start build at midnight for every Saturday:
59 23 * * 6

2. If you want to trigger a job when new code is pushed, then select 'Build when change is pushed to Bitbucket' option under the 'Build Triggers' section of Jenkins Job.

Related questions