Jenkins Pipeline method not to retry when the job result is Unstable

aaa job calls bbb job, bbb job is set to unstable

retry(2){
    try{
    def result=build job: "bbb"
    echo result
    }catch(err){
        if(!err.getMessage().contains("UNSTABLE"))
        throw err
    }
}

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326794372&siteId=291194637