0
how to trigger for every build in Jenkins?

Solved 2 Answers 36 Views
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.

2 Answers

1
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 May 19 by stbadmin (4,912 points)
selected May 19 by SunilBhaskar
0

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)

Examples:
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.

answered Jul 6 by sumitkumarwatts (138 points)
edited Jul 11 by sumitkumarwatts
...