fix(docker): normalize plugin build args

This commit is contained in:
Vincent Koc
2026-05-04 15:16:04 -07:00
parent 0908f3d538
commit a07d8cbf8a
2 changed files with 13 additions and 4 deletions

View File

@@ -105,9 +105,18 @@ describe("Dockerfile", () => {
it("prunes runtime dependencies after the build stage", async () => {
const dockerfile = await readFile(dockerfilePath, "utf8");
const normalizedExtensionLoop =
"for ext in $(printf '%s\\n' \"$OPENCLAW_EXTENSIONS\" | tr ',' ' '); do \\";
expect(dockerfile).toContain("FROM build AS runtime-assets");
expect(dockerfile).toContain("ARG OPENCLAW_EXTENSIONS");
expect(dockerfile).toContain("ARG OPENCLAW_BUNDLED_PLUGIN_DIR");
expect(dockerfile).toContain(
"Opt-in plugin dependencies at build time (space- or comma-separated directory names).",
);
expect(dockerfile).toContain(
'Example: docker build --build-arg OPENCLAW_EXTENSIONS="diagnostics-otel,matrix" .',
);
expect(dockerfile.split(normalizedExtensionLoop).length - 1).toBe(2);
expect(dockerfile).toContain("pnpm-workspace.runtime.yaml");
expect(dockerfile).toContain(" - ui\\n");
expect(dockerfile).toContain("CI=true NPM_CONFIG_FROZEN_LOCKFILE=false pnpm prune --prod");