Skip to content

Commit

Permalink
Add description for UploadLogCommand options
Browse files Browse the repository at this point in the history
  • Loading branch information
ruhan1 committed Dec 25, 2024
1 parent 53c0439 commit 4672344
Showing 1 changed file with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import io.quarkus.logging.Log;
import picocli.CommandLine;

import static org.apache.commons.lang3.StringUtils.isBlank;

@CommandLine.Command(name = "upload-log")
public class UploadLogCommand implements Runnable {

Expand All @@ -25,29 +27,38 @@ public class UploadLogCommand implements Runnable {
@CommandLine.Option(names = "--file", required = true)
String logFile;

@CommandLine.Option(names = "--bifrost-url", required = true)
@CommandLine.Option(names = "--bifrost-url")
String bifrostURL;

@CommandLine.Option(names = "--max-retries")
int maxRetries = DEFAULT_MAX_RETRIES;

@CommandLine.Option(names = "--delay-seconds")
@CommandLine.Option(names = "--delay-seconds",
description = "in case of retries this is the delay in seconds before next retry")
int delaySeconds = DEFAULT_DELAY_SECONDS;

@CommandLine.Option(names = "--process-context", required = true)
@CommandLine.Option(names = "--process-context",
description = "id of an long running operation (in this case the build-id is used)")
String processContext;

@CommandLine.Option(names = "--process-context-variant", required = true)
@CommandLine.Option(names = "--process-context-variant",
description = "in case there are subtasks or retries of individual steps this field can be used to add another ID")
String processContextVariant;

@CommandLine.Option(names = "--tmp", required = true)
String tmp;
@CommandLine.Option(names = "--tmp",
description = "temp build or not, used for a log clean-up")
String tmp = "false";

@CommandLine.Option(names = "--request-context", required = true)
@CommandLine.Option(names = "--request-context",
description = "an id of the initial (http) request that triggered this and potentially other processes")
String requestContext;

public void run() {
try {
if (isBlank(bifrostURL)) {
Log.info("No bifrost url specified and no log upload is performed");
return;
}
var logFilePath = Path.of(logFile);
var file = logFilePath.toFile();
if (!file.exists()) {
Expand Down

0 comments on commit 4672344

Please sign in to comment.