fix: proxy code queue direct docker publish

This commit is contained in:
Codex
2026-05-23 21:19:57 +00:00
parent 086dc5645a
commit 97fe2a6b51
2 changed files with 39 additions and 0 deletions
+35
View File
@@ -1524,6 +1524,39 @@ function buildContextForService(serviceId: string, dockerfile: string): string {
return serviceId === "claudeqq" ? posixPath.dirname(dockerfile) : ".";
}
function directDockerBuildNetworkArgs(serviceId: string): string[] {
if (serviceId !== "code-queue") return [];
const noProxy = [
"localhost",
"127.0.0.1",
"::1",
"host.docker.internal",
"d601-tcp-egress-gateway",
"d601-tcp-egress-gateway.unidesk",
"d601-tcp-egress-gateway.unidesk.svc",
"d601-tcp-egress-gateway.unidesk.svc.cluster.local",
"backend-core",
"oa-event-flow",
"database",
].join(",");
return [
"--network",
"host",
"--build-arg",
`HTTP_PROXY=${providerGatewayWsEgressProxyUrl}`,
"--build-arg",
`HTTPS_PROXY=${providerGatewayWsEgressProxyUrl}`,
"--build-arg",
`http_proxy=${providerGatewayWsEgressProxyUrl}`,
"--build-arg",
`https_proxy=${providerGatewayWsEgressProxyUrl}`,
"--build-arg",
`NO_PROXY=${noProxy}`,
"--build-arg",
`no_proxy=${noProxy}`,
];
}
function directDockerSourceGitMode(repoUrl: string): "local-unidesk-worktree" | "git-archive" {
return repoUrl === "https://github.com/pikasTech/unidesk" ? "local-unidesk-worktree" : "git-archive";
}
@@ -1575,6 +1608,7 @@ async function publishUserServiceArtifactDirectDocker(options: CiPublishUserServ
const planned = artifactSummaryDefaults(context);
const localImage = `${options.imageRepository}:${options.commit}`;
const buildContext = buildContextForService(options.serviceId, options.dockerfile);
const networkArgs = directDockerBuildNetworkArgs(options.serviceId);
const baseArgs = options.serviceId === "code-queue" && runCommand(["docker", "image", "inspect", "unidesk-code-queue:d601"], repoRoot, { timeoutMs: 30_000 }).exitCode === 0
? ["--build-arg", "CODE_QUEUE_BASE_IMAGE=unidesk-code-queue:d601"]
: [];
@@ -1614,6 +1648,7 @@ async function publishUserServiceArtifactDirectDocker(options: CiPublishUserServ
`unidesk.ai/source-commit=${options.commit}`,
"--label",
`unidesk.ai/dockerfile=${options.dockerfile}`,
...networkArgs,
...baseArgs,
"-t",
localImage,