mirror of
https://github.com/Dasemu/remote-mcp-manager.git
synced 2026-11-28 08:17:26 +00:00
fix: pass NIXPACKS_NODE_VERSION as a CLI flag, not a process env var
nixpacks doesn't read NIXPACKS_* config from the process environment at all, only from -e/--env on its own CLI — the "fix" from the previous commit was silently a no-op (nixpacks plan still showed nodejs_18 for a repo pinned to 20 that way). Caught because the first real container built with it still crashed the same way. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9f88769922
commit
021fa2220e
2 files changed
+14
-4
No files matched your search
@@ -61,14 +61,17 @@ export function runNixpacksBuild(slug: string, repoDir: string, imageTag: string
|
||||
fs.mkdirSync(path.dirname(logPath), { recursive: true });
|
||||
const logStream = fs.createWriteStream(logPath, { flags: "a" });
|
||||
|
||||
const env = { ...process.env };
|
||||
const args = ["build", repoDir, "--name", imageTag];
|
||||
const nodeVersion = detectNodeVersion(repoDir);
|
||||
if (nodeVersion) {
|
||||
env.NIXPACKS_NODE_VERSION = nodeVersion;
|
||||
// nixpacks does NOT read NIXPACKS_* config from the process environment — only from
|
||||
// its own `-e`/`--env` CLI flag (confirmed: setting it as a plain env var is silently
|
||||
// ignored, `nixpacks plan` still showed nodejs_18 for a repo pinned to 20 that way).
|
||||
args.push("-e", `NIXPACKS_NODE_VERSION=${nodeVersion}`);
|
||||
logStream.write(`[remote-mcp-manager] pinning NIXPACKS_NODE_VERSION=${nodeVersion}\n`);
|
||||
}
|
||||
|
||||
const child = spawn("nixpacks", ["build", repoDir, "--name", imageTag], { env });
|
||||
const child = spawn("nixpacks", args);
|
||||
child.stdout.pipe(logStream, { end: false });
|
||||
child.stderr.pipe(logStream, { end: false });
|
||||
|
||||
|
||||
Reference in new issue
Block a user