Skip to content

Commit

Permalink
Alter output based on the job CC (abend, error, ok) [JENKINS-31837].
Browse files Browse the repository at this point in the history
  • Loading branch information
candiduslynx committed Oct 17, 2016
1 parent 2233e8f commit c819c80
Showing 1 changed file with 16 additions and 5 deletions.
Expand Up @@ -178,11 +178,22 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListener lis

// Print the info about the job
logger.info("Job [" + zFTPConnector.getJobID() + "] processing finished.");
listener.getLogger().println(
"Job ["
+ zFTPConnector.getJobID()
+ "] processing finished. Captured RC = ["
+ printableCC + "]");
StringBuilder reportBuilder = new StringBuilder();
reportBuilder.append("Job [");
reportBuilder.append(zFTPConnector.getJobID());
reportBuilder.append("] processing ");
if (!printableCC.matches("\\d+")) {
if (printableCC.startsWith("ABEND")) {
reportBuilder.append("ABnormally ENDed. ABEND code = [");
} else {
reportBuilder.append("failed. Reason: [");
}
} else {
reportBuilder.append("finished. Captured RC = [");
}
reportBuilder.append(printableCC);
reportBuilder.append("]");
listener.getLogger().println(reportBuilder.toString());

// If wait was requested try to save the job log.
if(this.wait) {
Expand Down

0 comments on commit c819c80

Please sign in to comment.