@alignfirst/openclaw-test 0.21.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/env-cli.js +43 -0
- package/package.json +6 -6
package/dist/env-cli.js
CHANGED
|
@@ -407,6 +407,49 @@ function setupHostEnv(packageDir) {
|
|
|
407
407
|
process.env.ASSISTANT_GID = String(process.getgid?.() ?? 1000);
|
|
408
408
|
absolutizePathVarsFromEnvFile(projectDir);
|
|
409
409
|
applyPathDefaults(projectDir);
|
|
410
|
+
pinBuilderReadingLocalImages();
|
|
411
|
+
}
|
|
412
|
+
// The consumer Dockerfile resolves the base image with `FROM paleo/openclaw-test-base:<tag>`,
|
|
413
|
+
// a tag that exists only in the local image store. Only a `docker`-driver builder reads that
|
|
414
|
+
// store: a `docker-container` or `remote` builder tries the registry instead and fails with an
|
|
415
|
+
// opaque `pull access denied`. `docker build` always picks the docker driver, so the base image
|
|
416
|
+
// itself is unaffected, but `docker compose build` follows the selected builder — so a developer
|
|
417
|
+
// who selected a container builder for everything else cannot build the consumer image.
|
|
418
|
+
// Point BUILDX_BUILDER at the docker-driver builder, whose name follows the Docker context and
|
|
419
|
+
// is only `default` on the default one. An explicit BUILDX_BUILDER wins, as does the selected
|
|
420
|
+
// builder when it already reads the store.
|
|
421
|
+
function pinBuilderReadingLocalImages() {
|
|
422
|
+
if (process.env.BUILDX_BUILDER)
|
|
423
|
+
return;
|
|
424
|
+
const builders = listBuilders();
|
|
425
|
+
if (builders.some((builder) => builder.current && builder.driver === "docker"))
|
|
426
|
+
return;
|
|
427
|
+
const local = builders.find((builder) => builder.driver === "docker");
|
|
428
|
+
if (local)
|
|
429
|
+
process.env.BUILDX_BUILDER = local.name;
|
|
430
|
+
}
|
|
431
|
+
// `buildx ls --format json` emits one builder per line. Tolerate every failure: an older Docker
|
|
432
|
+
// without the flag, or a malformed line, leaves the selection untouched and the build reports
|
|
433
|
+
// its own error.
|
|
434
|
+
function listBuilders() {
|
|
435
|
+
const r = spawnSync("docker", ["buildx", "ls", "--format", "json"], { encoding: "utf8" });
|
|
436
|
+
if (r.status !== 0 || !r.stdout)
|
|
437
|
+
return [];
|
|
438
|
+
return r.stdout
|
|
439
|
+
.split("\n")
|
|
440
|
+
.map((line) => line.trim())
|
|
441
|
+
.filter(Boolean)
|
|
442
|
+
.flatMap((line) => {
|
|
443
|
+
try {
|
|
444
|
+
const parsed = JSON.parse(line);
|
|
445
|
+
if (!parsed.Name || !parsed.Driver)
|
|
446
|
+
return [];
|
|
447
|
+
return [{ name: parsed.Name, driver: parsed.Driver, current: parsed.Current === true }];
|
|
448
|
+
}
|
|
449
|
+
catch {
|
|
450
|
+
return [];
|
|
451
|
+
}
|
|
452
|
+
});
|
|
410
453
|
}
|
|
411
454
|
// Defaults relative to the consumer's project dir, applied after `.env.local` so
|
|
412
455
|
// explicit values win. Doing this in the CLI (not via `${VAR:-default}` in
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alignfirst/openclaw-test",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"description": "Dockerised regression-test framework for OpenClaw workspaces: bus, scenario driver, judge, Compose stack.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openclaw",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"openclaw": "*"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@alignfirst/openclaw-channel-mock-core": "0.10.
|
|
48
|
-
"@alignfirst/openclaw-discord-mock": "0.6.
|
|
49
|
-
"@alignfirst/openclaw-slack-mock": "0.6.
|
|
50
|
-
"@anthropic-ai/sdk": "~0.
|
|
47
|
+
"@alignfirst/openclaw-channel-mock-core": "0.10.1",
|
|
48
|
+
"@alignfirst/openclaw-discord-mock": "0.6.1",
|
|
49
|
+
"@alignfirst/openclaw-slack-mock": "0.6.1",
|
|
50
|
+
"@anthropic-ai/sdk": "~0.127.0",
|
|
51
51
|
"openai": "~7.8.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
@@ -55,6 +55,6 @@
|
|
|
55
55
|
"openclaw": "~2026.9.3",
|
|
56
56
|
"rimraf": "~6.1.3",
|
|
57
57
|
"typescript": "~7.0.2",
|
|
58
|
-
"vitest": "~
|
|
58
|
+
"vitest": "~5.0.1"
|
|
59
59
|
}
|
|
60
60
|
}
|