Do you have questions ? We got the answers!

Ask a question:

0
how to trigger for every build in Jenkins?

Solved 2 Answers 43 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,970 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 (363 points)
edited Jul 11 by sumitkumarwatts

Top Contributors

  • 4970 pointsstbadmin

    34 questions 454 answers218 comments

  • 433 pointsSunilBhaskar

    41 questions 15 answers32 comments

  • 425 pointsMehedi

    36 questions 3 answers14 comments

  • 363 pointssumitkumarwatts

    0 questions 13 answers0 comments

  • 354 pointsSoft Tester

    43 questions 0 answers4 comments

  • 327 pointsKeeshaGolden

    0 questions 17 answers2 comments

  • 322 pointsVipul Sharma

    44 questions 0 answers24 comments

  • 310 pointsvysh.sharma

    25 questions 0 answers0 comments

  • 267 pointsOnkar_Nimje

    33 questions 15 answers15 comments

  • 258 pointsVanitha

    26 questions 0 answers6 comments

...