Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to add a command line script to Jenkins as part of the build process. This command line script will exit with an error code of 0 if things where successful or 666 if it fails. I wish to stop the build if this script fails.

Is it possible to do this using Jenkins? If so how?

share|improve this question

1 Answer

Your bash build script can set -e prior to running your test.

set -e will cause Jenkins to stop the build if there's a non-zero exit status during the build. You would have something like this in the Execute Shell box in the project configuration:

set -e
yourcommand1
yourcommand2

Here's some documentation on bash options.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.