S19: share workstation runner and move agent workflows to landscape
This commit is contained in:
@@ -3,9 +3,15 @@ import java.time.*;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
||||
/** Run from the repository root with JDK 25: java ci/Ci.java <command>. */
|
||||
/** Run from the repository root with JDK 25: java generated/ci/Ci.java <command>. */
|
||||
public class Ci {
|
||||
public static void main(String[] args) {
|
||||
/**
|
||||
* Runs a CI, release or workstation setup command from the consumer repository root.
|
||||
*
|
||||
* @param args command followed by its optional arguments; configuration comes from the project and environment
|
||||
* @implNote Requires JDK 25. Failures exit nonzero with redacted diagnostics; setup commands can change local or Gitea state.
|
||||
*/
|
||||
public static void main(final String... args) {
|
||||
try {
|
||||
if (Runtime.version().feature() < 25) throw new IllegalArgumentException("JDK 25 or newer is required");
|
||||
if (args.length == 0) throw new IllegalArgumentException(usage());
|
||||
@@ -30,6 +36,8 @@ public class Ci {
|
||||
file, "CI_RUN_ATTEMPT=" + id + "\n", StandardOpenOption.CREATE, StandardOpenOption.APPEND);
|
||||
}
|
||||
case "configure-gitea" -> Setup.configureGitea(env);
|
||||
case "configure-runner" -> Setup.configureRunner(env);
|
||||
case "check-runner" -> Setup.checkRunner(env);
|
||||
case "configure-docker" -> {
|
||||
if (args.length != 2) throw new IllegalArgumentException("Supply the daemon.json path");
|
||||
Setup.configureDocker(Path.of(args[1]), Setup.required(env, "INSECURE_REGISTRY"));
|
||||
@@ -56,7 +64,8 @@ public class Ci {
|
||||
}
|
||||
|
||||
static String usage() {
|
||||
return "Usage: java ci/Ci.java verify|publish|cleanup|attempt|test|configure-gitea|configure-docker"
|
||||
return "Usage: java generated/ci/Ci.java"
|
||||
+ " verify|publish|cleanup|attempt|test|configure-gitea|configure-runner|check-runner|configure-docker"
|
||||
+ " <path>|install-runner [--prepare-only]|deploy|rollback|release-test|configure-deployment";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user