Skip to content

Commit

Permalink
Add --no-build-logs option to disable writing builds logs to stdout o…
Browse files Browse the repository at this point in the history
…f Jenkins

* Add --no-stdout option to disable logging to stdout of Jenkins

* Change option name to --no-build-logs
  • Loading branch information
syurevich authored Jun 14, 2023
1 parent 0d86758 commit b005ef4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,9 @@ public class PipelineRunOptions extends PipelineOptions {
@CommandLine.Option(names = { "-pc", "--pipeline-configuration" },
description = "The Pipeline Configuration File when using the Jenkins Templating Engine")
public File pipelineConfiguration;

@CommandLine.Option(names = { "-nbl", "--no-build-logs" },
description = "Disable writing build logs to stdout. " +
"Plugins that handle build logs will process them as usual")
public boolean noBuildLogs = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ public int run(PipelineRunOptions runOptions) throws Exception {

b = f.getStartCondition().get();

writeLogTo(System.out);
if (!runOptions.noBuildLogs) {
writeLogTo(System.out);
}

f.get(); // wait for the completion
return b.getResult().ordinal;
Expand Down

0 comments on commit b005ef4

Please sign in to comment.