Update: Newer versions of Jenkins support exit codes that would set unstable
. For more info, please refer here (thanks @Pedro and @gib)
I did not test this.
Original answer below:
No. A script exit code will not produce UNSTABLE
build result in Jenkins.
The only way to set UNSTABLE
build result is programmatically through Jenkins.
This is what the test harness portion of Jenkins does.
You can also use the Jenkins CLI directly from your script to set result of the currently executing build. Instead of returning a specific exit code, have your script execute the Jenkins CLI command. For details, on your own server, goto http://<your-server>/cli/command/set-build-result
There are also a number of plugins that can do that same, including:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…