I'm trying to use a Workflow (ver 1.6) to string together a series of freestyle jobs.
What I believe I'm seeing is that a minimal Job object is returned in the event that the freestyle job completes successfully. If the downstream freestyle job either fails or is aborted though, I get an exception raised that includes the result as its text... but not much of anything else.
My goal is to provide a linkage within my Workflow job to each of these downstream jobs, but as it stands now I'm only seeing that I can identify it if everything goes just right.
Here's an example snippet of what I'm doing currently:
try {
def buildStatus = build job: DOWNSTREAM_BUILD
def result = buildStatus.getResult()
def number = buildStatus.getNumber()
echo url
} catch(e) {
echo e.getMessage()
error 'DOWNSTREAM_JOB did not start/complete normally'
}
My biggest concern is that I can't figure out to get the corresponding build information in the event of a failure. Past that, I'd also really like to avoid having to embed the base URL of my server... it seems like I ought to be able to get that from the job I'm running.
Does anyone have ideas on this? Am I approaching this the wrong way? Or is this a limitation of the Workflow plugin today?
Rick