Jenkins MultiJob - Email Results with Data from Internal Jobs

I have a MultiJob project with three internal tasks to be performed in the following sequence

Master MultiJob Project (Job) |----- Phase 1 |------> JOB A |----- Phase 2 |------> JOB B |----- Phase 2 |------> JOB C 

When Job C ends, the Master MultiJob Project (Job) will send mail (using the Email-ext plugin ) with the status of the results from all internal tasks (A, B and C) (as a step after assembly)

I need to find a way to get results from each of these internal tasks (as a parameter or in any other way ...)

I tried to do this:

  • Setting up Enviroment Variable and then trying to read it - Failed - Varaiable is no longer exisintg after completing an A / B / C job
  • Tried to do it using SETX, same results
  • Tried to use EnvInject Plugin and failed again.

in any case, is it not so?

Can someone obscure some light?

+4
source share
1 answer

Assuming your job is Multijob, you can add post post groovy as follows:

 subBuilds = manager.build.getSubBuilds() //print the each sub build instance to the console log and its result subBuilds.each{ manager.listener.logger.println "${it}, ${it.getResult()}" } 
+1
source

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


All Articles