Il giorno giovedì 19 maggio 2016 10:19:35 UTC+2, Antonio Hernandez ha
scritto:
> I'm wondering how to manage the result of a job in other way as jenkins
> does because i have a job that the only thing it runs is a .jar file that
> can finsih ok or not but in both cases jenkins marks it as SUCESS, here is
> an example:
>
Hi,
success or failure of jenkins jobs depends on the return value of
scripts/commands you launch from jenkins job configuration, so maybe you
just have to check the workflow of your job to be sure you are not ignoring
return values.
Anyway, you can also use the Groovy Postbuild plugin to check for lines in
console output and change job result accordingly; you can use a groovy
script like this:
// Fail for Java exceptions
if(manager.logContains(".*Exception in thread.*")) {
manager.addErrorBadge("Java exception")
manager.createSummary("warning.gif").appendText("<h3>Java exception
detected.</h3>", false, false, false, "red")
manager.buildFailure()
}
--
01
--
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/41752bb0-99db-4bd1-b0a4-a2acb5022b32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.