fix: show runtime lane git mirror next commands
This commit is contained in:
@@ -492,6 +492,7 @@ assertCondition(
|
||||
&& sourceText.includes("control-plane cleanup-runs requires --lane v02|v03|g14|all")
|
||||
&& sourceText.includes("printRuntimeLaneTriggerProgress")
|
||||
&& sourceText.includes("hwlab.runtime-lane.trigger.progress")
|
||||
&& sourceText.includes("hwlab nodes control-plane trigger-current --node")
|
||||
&& jobsSourceText.includes("hwlab-runtime-lane-trigger")
|
||||
&& jobsSourceText.includes("hwlab.runtime-lane.trigger.progress")
|
||||
&& jobsSourceText.includes("hwlab nodes control-plane status --node"),
|
||||
|
||||
@@ -5720,6 +5720,7 @@ function runGitMirrorApply(options: G14GitMirrorOptions): Record<string, unknown
|
||||
|
||||
function runGitMirrorSync(options: G14GitMirrorOptions): Record<string, unknown> {
|
||||
const startedAtMs = Date.now();
|
||||
const spec = hwlabRuntimeLaneSpec(options.lane);
|
||||
const jobName = gitMirrorSyncJobName();
|
||||
const manifest = gitMirrorSyncJobManifest(jobName);
|
||||
const manifestB64 = Buffer.from(JSON.stringify(manifest), "utf8").toString("base64");
|
||||
@@ -5755,9 +5756,15 @@ function runGitMirrorSync(options: G14GitMirrorOptions): Record<string, unknown>
|
||||
].join("\n"),
|
||||
].join("\n");
|
||||
const result = g14K3s(["script", "--", script], options.timeoutSeconds * 1000 + 30_000);
|
||||
const syncCommand = spec.lane === "v02"
|
||||
? "bun scripts/cli.ts hwlab g14 git-mirror sync --lane v02 --confirm"
|
||||
: `bun scripts/cli.ts hwlab nodes git-mirror sync --node ${spec.nodeId} --lane ${spec.lane} --confirm`;
|
||||
const triggerCommand = spec.lane === "v02"
|
||||
? "bun scripts/cli.ts hwlab g14 control-plane trigger-current --lane v02 --confirm"
|
||||
: `bun scripts/cli.ts hwlab nodes control-plane trigger-current --node ${spec.nodeId} --lane ${spec.lane} --confirm`;
|
||||
return {
|
||||
ok: isCommandSuccess(result),
|
||||
command: "hwlab g14 git-mirror sync",
|
||||
command: spec.lane === "v02" ? "hwlab g14 git-mirror sync" : "hwlab nodes git-mirror sync",
|
||||
mode: options.dryRun ? "dry-run" : "confirmed-sync",
|
||||
namespace: GIT_MIRROR_NAMESPACE,
|
||||
jobName,
|
||||
@@ -5765,7 +5772,7 @@ function runGitMirrorSync(options: G14GitMirrorOptions): Record<string, unknown>
|
||||
manifest: options.dryRun ? manifest : undefined,
|
||||
result: compactCommandResult(result),
|
||||
status: options.dryRun ? undefined : runGitMirrorStatus(),
|
||||
next: options.dryRun ? { sync: "bun scripts/cli.ts hwlab g14 git-mirror sync --confirm" } : { triggerCurrent: "bun scripts/cli.ts hwlab g14 control-plane trigger-current --lane v02 --confirm" },
|
||||
next: options.dryRun ? { sync: syncCommand } : { triggerCurrent: triggerCommand },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user