Merge pull request #182 from sebastienbonami/canceled_status
Status to canceled instead of failed if Jenkins build is aborted
This commit is contained in:
commit
9c3e58734a
|
@ -490,7 +490,15 @@ public class GitLabPushTrigger extends Trigger<Job<?, ?>> {
|
|||
|
||||
private void onCompletedPushRequest(Run run, GitLabPushCause cause) {
|
||||
if(addCiMessage) {
|
||||
cause.getPushRequest().createCommitStatus(this.getDescriptor().getGitlab().instance(), run.getResult()==Result.SUCCESS?"success":"failed", Jenkins.getInstance().getRootUrl() + run.getUrl());
|
||||
String status;
|
||||
if (run.getResult() == Result.ABORTED) {
|
||||
status = "canceled";
|
||||
}else if (run.getResult() == Result.SUCCESS) {
|
||||
status = "success";
|
||||
}else {
|
||||
status = "failed";
|
||||
}
|
||||
cause.getPushRequest().createCommitStatus(this.getDescriptor().getGitlab().instance(), status, Jenkins.getInstance().getRootUrl() + run.getUrl());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -531,7 +539,15 @@ public class GitLabPushTrigger extends Trigger<Job<?, ?>> {
|
|||
}
|
||||
|
||||
if(addCiMessage) {
|
||||
cause.getMergeRequest().createCommitStatus(this.getDescriptor().getGitlab().instance(), run.getResult()==Result.SUCCESS?"success":"failed", Jenkins.getInstance().getRootUrl() + run.getUrl());
|
||||
String status;
|
||||
if (run.getResult() == Result.ABORTED) {
|
||||
status = "canceled";
|
||||
}else if (run.getResult() == Result.SUCCESS) {
|
||||
status = "success";
|
||||
}else {
|
||||
status = "failed";
|
||||
}
|
||||
cause.getMergeRequest().createCommitStatus(this.getDescriptor().getGitlab().instance(), status, Jenkins.getInstance().getRootUrl() + run.getUrl());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -243,6 +243,8 @@ public class GitLabWebHook implements UnprotectedRootAction {
|
|||
//TODO: add status of pending when we figure it out.
|
||||
if(mainBuild.isBuilding()) {
|
||||
object.put("status", "running");
|
||||
}else if(res == Result.ABORTED) {
|
||||
object.put("status", "canceled");
|
||||
}else if(res == Result.SUCCESS) {
|
||||
object.put("status", "success");
|
||||
}else {
|
||||
|
|
Loading…
Reference in New Issue