问题
I have a MultiJob Project with 3 inner jobs which needs to be executed 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 a mail (Using the Email-ext plugin) with status about the results from all the inner Jobs (A, B and C) (As a Post Build Step)
I need to find a way to get a the results from each of these inner Jobs (as Parameter or any other way...)
I tried to do it by:
- Setting Enviroment Variable and then trying to read it - Failed - the Varaiable is not exisintg anymore after Job A/B/C ends
- Tried to do so with SETX, same results
- Tried to use the EnvInject Plugin and failed again
isn't there anyway to do so?
Can someone shade some light?
回答1:
Assuming your job is a Multijob, you can add a groovy post build like this:
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()}"
}
来源:https://stackoverflow.com/questions/17172927/jenkins-multijob-send-results-e-mail-with-data-from-inner-jobs