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()
                                           
    // Example URL Format: 
 http://jenkins.mydomain.com/job/DOWNSTRAM_BUILD/128/
    def url = "http://jenkins.mydomain.com/job/"; + DOWNSTREAM_BUILD + "/" + 
number.toString() + "/"
    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

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ca3c3acb-d2ff-4752-bf03-35b822c68ac5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to