cyberbemon cyberbemon - 2 months ago 5x
Python Question

Making a job fail in jenkins

This question might sound weird, but how do I make a job fail?

I have a python script that compiles few files using scons, and which is running as a jenkins job. The script tests if the compiler can build x64 or x86 binaries, I want the job to fail if it fails to do one of these.

For instance: if I'm running my script on a 64-bit system and it fails to compile a 64-bit. Is there something I can do in the script that might cause to fail?

Y__ Y__

If your script exit with a non-zero status the build should fail.

import sys