How do I “map” certain return value of a script to “yellow” status in Jenkins?

StackOverflow https://stackoverflow.com/questions/8081131

  •  25-02-2021
  •  | 
  •  

Question

In Jenkins there is a possibility to create free project which can contain a script execution. The build fails (becomes red) when the return level of the script is not 0.

Is there a possibility to make it "yellow"?
(Yellow usually indicates successful build with failed tests)

The system runs on Linux.

Était-ce utile?

La solution

Give the Log Parser Plugin a try. That should do the trick for you.

Autres conseils

One slightly hacky way do do it, is to alter the job to publish test results and supply fake results.

I've got a job that is publishing the test results from a file called "results.xml". The last step in my build script checks the return value of the build, copies eihter "results-good.xml" or "results-unstable.xml" to "results.xml" and then returns a zero.

Thus if the script fails on one of the early steps, the build is red. But if the build succeeds its green or yellow based on the return code it would have retunred without this hack.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top