Re: How to get build results from a build job in a pipeline

2018-09-27 Thread viacheslav . gordiievskyi
Trying to find the answer why it doesn't work for case when I use def jobBuild = build job: 'myjob', propagate: false, *wait:false* On Wednesday, May 17, 2017 at 12:55:33 PM UTC+3, Bill Dennis wrote: > > Ah just saw you need the job to call all builds even if one fails. You can > do it with a

Re: How to get build results from a build job in a pipeline

2017-05-17 Thread Jesse Kinross-Smith
Thanks Bill - appreciate the response. I found that not propagating the errors was the key - it would continue onto further tasks nicely if I did that. Only issue really is that if you watch the pipeline in Jenkins then it appears to show all green even if a step has failed. My build summary

Re: How to get build results from a build job in a pipeline

2017-05-17 Thread Jesse Kinross-Smith
So I was trying too hard - the try/catch isnt' needed at all. All I needed was: BuildResults = build job: 'testJob', propagate: false; notify_email(BuildResults); On Wednesday, May 17, 2017 at 10:45:27 AM UTC+8, Jesse Kinross-Smith wrote: > > How can I do this right - I want the results from

Re: How to get build results from a build job in a pipeline

2017-05-17 Thread Bill Dennis
Ah just saw you need the job to call all builds even if one fails. You can do it with a parallel section like this: Map buildResults = [:] Boolean failedJobs = false void nofify_email(Map results) { echo "TEST SIMULATE notify: ${results.toString()}" } Boolean buildJob(String jobName, Map

Re: How to get build results from a build job in a pipeline

2017-05-17 Thread Bill Dennis
You could build the downstream jobs without propagating the error to the top level job calling them. Then you could get the results from each downstream job and handle it to do the notifications according to SUCCESS/FAILURE/UNSTABLE etc. I do this sort of thing using declarative pipeline then

How to get build results from a build job in a pipeline

2017-05-16 Thread Jesse Kinross-Smith
How can I do this right - I want the results from a job I run (I need to run a dozen of these in succession and will email devs if one of them fails) try{ BuildResults = build job: 'testJob'; currentBuild.result='SUCCESS'; } > catch(e){ currentBuild.result = 'FAILURE'; } finally { >