Jenkins: Sending emails for each build step leads to the same Jenkins Job

I'm just wondering how to send an email with an ext-email plugin based on each result of the build step on the same Jenkins Job. Here is my script

My Jenkins work has 3 build steps

Build step1:

   Pull latest code from github and Build the app - Gradle task which build the Jar

Build step 2:

   Run all Tests against that Jar - Gradle Task which runs all Junit tests and provide Report files.

Action after assembly:

   If Build step1 fails -> Send email telling Build fails and Console Log with Exception detials

   If Build success and Tests run -> Send email with Test Reports

I think I will need to write a Pre-send script for the Email-Ext plugin. But I'm not sure how to write this script. Please, help.

+4
source share
2 answers

In a normal configuration, if assembly phase 1 fails, the assembly of Step 2 will not be performed in any case.

2 (), "", "".

Email-ext .

  • .
  • Advanced Settings....
  • .
  • Add Trigger.

" " " " (, " " )

"" , , ( 1 ).
"" , , .
"" , , , .

:
Any Build Step ( post-build, e-mail-ext, ) ( ). , -ext. , .

+8

, ext, 2 :

  • 1
    • , .
    • -ext
  • 2

()//

  • , / ,

1, , - 1. .

0

Source: https://habr.com/ru/post/1543476/


All Articles