fix: keep dev code queue deploy target side

This commit is contained in:
Codex
2026-05-18 03:37:53 +00:00
parent e5a5bed0f7
commit c514b6ca9e
4 changed files with 20 additions and 12 deletions
+5 -8
View File
@@ -1070,16 +1070,13 @@ function claudeqqDeployAssetOverlayCommands(): string[] {
function syncK8sControlManifestsScript(service: UniDeskMicroserviceConfig): string {
if (isDevK3sDeployService(service)) {
const manifest = k8sManifestPath(service);
if (!existsSync(rootPath(manifest))) throw new Error(`${service.id} dev k3s control manifest missing: ${manifest}`);
const encoded = Buffer.from(readFileSync(rootPath(manifest), "utf8"), "utf8").toString("base64");
return [
"set -euo pipefail",
`target_root=${shellQuote(targetWorkDir(service))}`,
`relative_path=${shellQuote(manifest)}`,
"target_file=\"$target_root/$relative_path\"",
"mkdir -p \"$(dirname \"$target_file\")\"",
`printf %s ${shellQuote(encoded)} | base64 -d > "$target_file"`,
"printf 'synced_k3s_control_manifest=%s\\n' \"$target_file\"",
"test -f \"$target_file\"",
"printf 'target_k3s_control_manifest=%s\\n' \"$target_file\"",
].join("\n");
}
if (service.deployment.mode !== "k3sctl-managed" || isUnideskRepo(service.repository.url)) return "";
@@ -2110,7 +2107,8 @@ async function applyOneService(config: UniDeskConfig, service: UniDeskMicroservi
const controlManifestSyncScript = syncK8sControlManifestsScript(service);
if (controlManifestSyncScript.length > 0) {
const controlManifestSync = await step(config, service, "sync-k3s-control-manifests", controlManifestSyncScript, targetIsMain(service) ? repoRoot : "/home/ubuntu", 90_000, !targetIsMain(service));
const controlManifestStep = isDevK3sDeployService(service) ? "verify-target-k3s-manifest" : "sync-k3s-control-manifests";
const controlManifestSync = await step(config, service, controlManifestStep, controlManifestSyncScript, targetIsMain(service) ? repoRoot : "/home/ubuntu", 90_000, !targetIsMain(service));
if (!pushStep(steps, controlManifestSync)) return { ok: false, serviceId: service.id, startedAt, finishedAt: nowIso(), resolvedCommit, before, steps };
}
@@ -2296,9 +2294,8 @@ export async function runDeployCommand(config: UniDeskConfig | null, args: strin
throw new Error(`deploy apply --env dev currently supports only ${[...devApplySupportedServiceIds].join(", ")}; unsupported selected services: ${unsupported.join(", ")}`);
}
if (config === null) throw new Error("deploy apply --env dev requires config.json");
const resolved = resolveManifestCommits(manifest, options.serviceId);
if (!options.runNow) return applyJob(config, args, options);
return await runApplyNow(config, resolved, options);
return await runApplyNow(config, manifest, options);
}
if (config === null) throw new Error("deploy local manifest mode requires config.json");
const manifest = resolveManifestCommits(await readDeployManifest(options.file), options.serviceId);