fix: make deploy ssh identity yaml first

This commit is contained in:
Codex
2026-06-28 03:56:44 +00:00
parent 37389faa68
commit b1447ad998
4 changed files with 509 additions and 69 deletions
+29 -1
View File
@@ -10,7 +10,7 @@ import { join, posix as posixPath } from "node:path";
import { blockedCatalogArtifactIds, catalogSummary, findCiCatalogArtifact, loadCiCatalog, supportedSourceBuildArtifactIds, type CiCatalogArtifact, type CiSourceBuildCatalogArtifact, type CiUpstreamImageCatalogArtifact } from "../ci-catalog";
import { runCommand } from "../command";
import { type UniDeskConfig, repoRoot, rootPath } from "../config";
import { ensureGithubSshIdentityForProvider, gitSshHttpConnectProxySource } from "../deploy-ssh-identity";
import { deploySshIdentityPlan, ensureGithubSshIdentityForProvider, gitSshHttpConnectProxySource } from "../deploy-ssh-identity";
import { jobWithTail, listJobs, readJob, startJob } from "../jobs";
import { coreInternalFetch } from "../microservices";
import {
@@ -61,6 +61,34 @@ export async function runCiCommand(config: UniDeskConfig, args: string[]): Promi
};
}
if (action === "status") return status(ciTarget(providerIdOption(args)));
if (action === "github-ssh-identity") {
const subAction = nameArg ?? "plan";
const target = providerIdOption(args);
const identityId = stringOption(args, "--identity") ?? stringOption(args, "--identity-id");
if (subAction === "plan") return deploySshIdentityPlan(target, identityId);
if (subAction === "ensure") {
if (!boolFlag(args, "--confirm")) {
const confirmArgs = [
"bun scripts/cli.ts ci github-ssh-identity ensure",
target === null ? "" : `--target ${target}`,
identityId === null ? "" : `--identity ${identityId}`,
"--confirm",
].filter((item) => item.length > 0).join(" ");
return {
ok: false,
action: "deploy-ssh-identity-ensure",
mutation: false,
mode: "confirm-required",
plan: deploySshIdentityPlan(target, identityId),
next: {
confirm: confirmArgs,
},
};
}
return await ensureGithubSshIdentityForProvider(config, target ?? "", identityId);
}
throw new Error("ci github-ssh-identity must be one of: plan, ensure");
}
if (action === "run") {
const target = ciTarget(providerIdOption(args));
const repoUrl = stringOption(args, "--repo") ?? stringOption(args, "--repo-url") ?? "https://github.com/pikasTech/unidesk";
+3 -1
View File
@@ -51,7 +51,7 @@ export function catalogArtifactDescriptor(artifact: CiCatalogArtifact): Record<s
export function ciHelp(): Record<string, unknown> {
const catalog = loadCiCatalog();
return {
command: "ci install|status|run|publish-backend-core|publish-user-service|run-dev-e2e|logs|cleanup-runs|cleanup-failed-pods",
command: "ci install|status|github-ssh-identity|run|publish-backend-core|publish-user-service|run-dev-e2e|logs|cleanup-runs|cleanup-failed-pods",
description: "Manage native k3s Tekton CI on D601 or G14. CI may publish commit-pinned image artifacts, but it intentionally does not deploy CD.",
examples: [
"bun scripts/cli.ts ci install",
@@ -60,6 +60,8 @@ export function ciHelp(): Record<string, unknown> {
"bun scripts/cli.ts ci install-status latest",
"bun scripts/cli.ts ci install --wait --skip-prewarm --skip-tekton-install",
"bun scripts/cli.ts ci plan --target D601",
"bun scripts/cli.ts ci github-ssh-identity plan --target D518",
"bun scripts/cli.ts ci github-ssh-identity ensure --target D518 --confirm",
"bun scripts/cli.ts ci install --target G14",
"bun scripts/cli.ts ci run --revision <commit>",
"bun scripts/cli.ts ci run --target G14 --revision <commit>",