aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sokolovsky <paul.sokolovsky@linaro.org>2011-12-05 17:40:20 +0200
committerPaul Sokolovsky <paul.sokolovsky@linaro.org>2011-12-05 17:40:20 +0200
commiteee1810803c04a914f0b96edd060bbfa59e60575 (patch)
tree520bf8fe6e97ec71092f2d8f6a26ba9a3d1f12c2
parentdbc9e44d7de8d1120f56b6138b1a58140e7cad0c (diff)
downloadjenkins-plugin-shell-status-eee1810803c04a914f0b96edd060bbfa59e60575.tar.gz
Recognize special exit codes and set build status based on them.
The actual changes beyond pristine Jenkins.
-rw-r--r--src/main/java/hudson/plugins/shell/ShellWithStatus.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/main/java/hudson/plugins/shell/ShellWithStatus.java b/src/main/java/hudson/plugins/shell/ShellWithStatus.java
index baf171e..18ef51a 100644
--- a/src/main/java/hudson/plugins/shell/ShellWithStatus.java
+++ b/src/main/java/hudson/plugins/shell/ShellWithStatus.java
@@ -249,7 +249,26 @@ public class ShellWithStatus extends CommandInterpreter {
e.printStackTrace(listener.fatalError(Messages.CommandInterpreter_CommandFailed()));
r = -1;
}
- return r==0;
+ switch (r) {
+ case 0:
+ break;
+ case 121:
+ build.setResult(Result.UNSTABLE);
+ break;
+ case 122:
+ build.setResult(Result.FAILURE);
+ break;
+ case 123:
+ build.setResult(Result.NOT_BUILT);
+ break;
+ case 124:
+ build.setResult(Result.ABORTED);
+ break;
+ default:
+ build.setResult(Result.FAILURE);
+ break;
+ }
+ return r==0 || r==121;
} finally {
try {
if(script!=null)