fix: YAML-first 治理 CI/CD target (#919)
* docs: specify cicd yaml target governance * fix: resolve cicd targets from yaml --------- Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// SPEC: PJ2026-01060307 控制面模块化 draft-2026-06-25-p0. cleanup module for scripts/src/ci.ts.
|
||||
// SPEC: PJ2026-01060308 cicd-yaml-targets draft-2026-06-25-cicd-yaml-targets.
|
||||
|
||||
// Moved mechanically from scripts/src/ci.ts:1206-1428 for #903.
|
||||
|
||||
@@ -24,7 +25,7 @@ import { runSshCommandCapture } from "../ssh";
|
||||
import type { CiCleanupFailedPodsOptions, CiCleanupRunsOptions, CiTarget } from "./types";
|
||||
import { ciTargetGuardShellLines, shellQuote, tailTextLines } from "./options";
|
||||
import { runRemoteKubectl } from "./remote";
|
||||
import { ciTarget, tektonPipelineVersion, tektonTriggersVersion } from "./types";
|
||||
import { ciTarget, ciTargetSourceSummary, tektonPipelineVersion, tektonTriggersVersion } from "./types";
|
||||
|
||||
export async function status(target = ciTarget(null)): Promise<Record<string, unknown>> {
|
||||
const summary = await runRemoteKubectl([
|
||||
@@ -40,6 +41,7 @@ export async function status(target = ciTarget(null)): Promise<Record<string, un
|
||||
return {
|
||||
ok: true,
|
||||
providerId: target.providerId,
|
||||
target: ciTargetSourceSummary(target),
|
||||
orchestrator: "native-k3s",
|
||||
tekton: {
|
||||
pipelineVersion: tektonPipelineVersion,
|
||||
@@ -156,8 +158,8 @@ export async function cleanupRuns(config: UniDeskConfig, options: CiCleanupRunsO
|
||||
stderrTail: tailTextLines(deletion.stderr, 80),
|
||||
},
|
||||
next: options.confirm
|
||||
? { status: `bun scripts/cli.ts ci status --provider-id ${options.target.providerId}` }
|
||||
: { confirm: `bun scripts/cli.ts ci cleanup-runs --provider-id ${options.target.providerId} --min-age-minutes ${options.minAgeMinutes} --limit ${options.limit} --confirm` },
|
||||
? { status: `bun scripts/cli.ts ci status --target ${options.target.targetId}` }
|
||||
: { confirm: `bun scripts/cli.ts ci cleanup-runs --target ${options.target.targetId} --min-age-minutes ${options.minAgeMinutes} --limit ${options.limit} --confirm` },
|
||||
};
|
||||
}
|
||||
|
||||
@@ -244,7 +246,7 @@ export async function cleanupFailedPods(config: UniDeskConfig, options: CiCleanu
|
||||
stderrTail: tailTextLines(result.stderr, 20),
|
||||
},
|
||||
next: options.confirm
|
||||
? { status: `bun scripts/cli.ts ci status --provider-id ${options.target.providerId}` }
|
||||
: { confirm: `bun scripts/cli.ts ci cleanup-failed-pods --provider-id ${options.target.providerId} --namespace ${options.namespace} --min-age-minutes ${options.minAgeMinutes} --limit ${options.limit} --confirm` },
|
||||
? { status: `bun scripts/cli.ts ci status --target ${options.target.targetId}` }
|
||||
: { confirm: `bun scripts/cli.ts ci cleanup-failed-pods --target ${options.target.targetId} --namespace ${options.namespace} --min-age-minutes ${options.minAgeMinutes} --limit ${options.limit} --confirm` },
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user