Довёл fix20: firewall-mode, staged state, diagnostics, readiness и build-gate
This commit is contained in:
+35
-10
@@ -1,5 +1,5 @@
|
||||
import { install } from "./commands/install";
|
||||
import { reconfigure } from "./commands/reconfigure";
|
||||
import { reconfigure, repair } from "./commands/reconfigure";
|
||||
import { doctor } from "./commands/doctor";
|
||||
import { status } from "./commands/status";
|
||||
import { diagnosticsCollect } from "./commands/diagnostics";
|
||||
@@ -7,11 +7,13 @@ import type { InstallOptions, ReconfigureOptions } from "./types/context";
|
||||
|
||||
function usage(): never {
|
||||
console.error("Usage:");
|
||||
console.error(" hy2xs-orchestrator install --package-dir <path> [--config <path>] [--skip-firewall] [--skip-start] [--non-interactive]");
|
||||
console.error(" hy2xs-orchestrator reconfigure --package-dir <path> [--config <path>] [--dry-run|--apply] [--skip-firewall] [--skip-start]");
|
||||
console.error(" hy2xs-orchestrator doctor --package-dir <path> [--config <path>] [--skip-firewall] [--skip-start]");
|
||||
console.error(" hy2xs-orchestrator status --package-dir <path> [--config <path>] [--skip-firewall] [--skip-start]");
|
||||
console.error(" hy2xs-orchestrator diagnostics collect --package-dir <path> [--config <path>] [--skip-firewall] [--skip-start]");
|
||||
console.error(" hy2xs-orchestrator install --package-dir <path> [--config <path>] [--skip-firewall] [--skip-service-start] [--skip-smoke] [--non-interactive]");
|
||||
console.error(" hy2xs-orchestrator reconfigure --package-dir <path> [--config <path>] [--dry-run|--apply] [--skip-firewall] [--skip-service-start] [--skip-smoke]");
|
||||
console.error(" hy2xs-orchestrator repair --package-dir <path> [--config <path>] [--skip-firewall] [--skip-service-start] [--skip-smoke]");
|
||||
console.error(" hy2xs-orchestrator doctor --package-dir <path> [--config <path>] [--skip-firewall] [--skip-service-start] [--skip-smoke]");
|
||||
console.error(" hy2xs-orchestrator status --package-dir <path> [--config <path>] [--skip-firewall] [--skip-service-start] [--skip-smoke]");
|
||||
console.error(" hy2xs-orchestrator diagnostics collect --package-dir <path> [--config <path>] [--skip-firewall] [--skip-service-start] [--skip-smoke]");
|
||||
console.error(" note: --skip-start is deprecated alias for --skip-service-start --skip-smoke");
|
||||
process.exit(2);
|
||||
}
|
||||
|
||||
@@ -31,7 +33,8 @@ function parseInstallOptions(args: string[]): InstallOptions {
|
||||
runtimeConfigPath: "/etc/hy2xs/hy2xs.env",
|
||||
nonInteractive: false,
|
||||
skipFirewall: false,
|
||||
skipStart: false
|
||||
skipServiceStart: false,
|
||||
skipSmoke: false
|
||||
};
|
||||
|
||||
for (let i = 0; i < args.length; i += 1) {
|
||||
@@ -47,8 +50,16 @@ function parseInstallOptions(args: string[]): InstallOptions {
|
||||
case "--skip-firewall":
|
||||
options.skipFirewall = true;
|
||||
break;
|
||||
case "--skip-service-start":
|
||||
options.skipServiceStart = true;
|
||||
break;
|
||||
case "--skip-smoke":
|
||||
options.skipSmoke = true;
|
||||
break;
|
||||
case "--skip-start":
|
||||
options.skipStart = true;
|
||||
console.error("warning: --skip-start is deprecated; use --skip-service-start and/or --skip-smoke");
|
||||
options.skipServiceStart = true;
|
||||
options.skipSmoke = true;
|
||||
break;
|
||||
case "--config":
|
||||
options.sourceConfigPath = takeValue(args, i, arg);
|
||||
@@ -77,7 +88,8 @@ function parseReconfigureOptions(args: string[]): ReconfigureOptions {
|
||||
dryRun: false,
|
||||
apply: false,
|
||||
skipFirewall: false,
|
||||
skipStart: false
|
||||
skipServiceStart: false,
|
||||
skipSmoke: false
|
||||
};
|
||||
|
||||
for (let i = 0; i < args.length; i += 1) {
|
||||
@@ -100,8 +112,16 @@ function parseReconfigureOptions(args: string[]): ReconfigureOptions {
|
||||
case "--skip-firewall":
|
||||
options.skipFirewall = true;
|
||||
break;
|
||||
case "--skip-service-start":
|
||||
options.skipServiceStart = true;
|
||||
break;
|
||||
case "--skip-smoke":
|
||||
options.skipSmoke = true;
|
||||
break;
|
||||
case "--skip-start":
|
||||
options.skipStart = true;
|
||||
console.error("warning: --skip-start is deprecated; use --skip-service-start and/or --skip-smoke");
|
||||
options.skipServiceStart = true;
|
||||
options.skipSmoke = true;
|
||||
break;
|
||||
default:
|
||||
console.error(`Unknown argument: ${arg}`);
|
||||
@@ -136,6 +156,11 @@ async function main(): Promise<void> {
|
||||
await reconfigure(parseReconfigureOptions(args));
|
||||
return;
|
||||
}
|
||||
if (command === "repair") {
|
||||
const options = parseReconfigureOptions(["--apply", ...args]);
|
||||
await repair(options);
|
||||
return;
|
||||
}
|
||||
if (command === "doctor") {
|
||||
const options = parseReconfigureOptions(["--dry-run", ...args]);
|
||||
await doctor(options);
|
||||
|
||||
Reference in New Issue
Block a user