Jenkins: Sending email based on each build step result in same Jenkins Job

后端 未结 2 1335
孤独总比滥情好
孤独总比滥情好 2021-01-13 18:44

I am just wondering how to send out email with Email-ext plugin based on each build step result on same Jenkins Job. Here is my scenario

My Jenkins job has 3 Build s

2条回答
  •  忘掉有多难
    2021-01-13 19:11

    Instead of customizing email ext consider breaking up job into 2 jobs:

    • job 1 builds and has this post build configuration
      • Build Other Projects with Trigger only if build succeeds checked
      • Configure email-ext to only send mail in case of failure
    • job 2 runs test and sends mail

    For both jobs set job parameters in (job)/Configure/Advanced Project Options to

    • Use custom workspace to share the same workspace
    • Block build when up/downstream project is building to avoid overwriting

    If you'd also like to attach test results to job 1 in case it was successful, add in post build steps in job 1 Aggregate downstream test results.

提交回复
热议问题