Preview: Build 2 GB, kein Dev-Rueckfall bei bestehender Preview, oeffentliche Seiten nie automatisch auf Dev

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-09-30 22:29:26 +00:00
1 parent c256b78dae
commit 56637f2005
6 files changed
+51 -5

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@ const ENV_NAME_RE = /^[A-Z_][A-Z0-9_]*$/;
const NAME_RE = /^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,127}$/;
const NETWORK = 'preview-sandbox'; // fest (R10), kein Parameter
const IMAGES = ['node:20', 'oven/bun:1'];
const MEMORIES = ['1g', '512m'];
const MEMORIES = ['2g', '1g', '512m'];
const MAX_LINE = 64 * 1024;
// Feste, unkritische Umgebung im Container (R9): Caches landen im gemounteten Cache-Verzeichnis.
const FIXED_ENV = ['HOME=/cache/home', 'npm_config_cache=/cache/npm', 'COREPACK_HOME=/cache/corepack'];
+7 -3
View File
@@ -197,8 +197,10 @@ export function createJobs({ config, docker, fs: fsOver = {}, git, mem = readMem
await fs.chownR(workDir);
await fs.chownR(cacheDir); // R7
const remaining = Math.max(1000, deadline - now());
const args = buildRunArgs({ image: imageFor(pm), name: `preview-build-${id}-${step}`, workDir, cacheDir, workRoot: config.workRoot, cacheRoot: config.cacheRoot, cmd: withCorepack(pm, cmd), memory: '1g' });
return docker.run(args, { env, timeoutMs: remaining, onLine: (l) => onLine(l) });
const args = buildRunArgs({ image: imageFor(pm), name: `preview-build-${id}-${step}`, workDir, cacheDir, workRoot: config.workRoot, cacheRoot: config.cacheRoot, cmd: withCorepack(pm, cmd), memory: '2g' });
const r = await docker.run(args, { env, timeoutMs: remaining, onLine: (l) => onLine(l) });
if (r && r.code === 137) onLine('Build am Speicherlimit abgebrochen (Exit 137)');
return r;
}
const failText = (what, code, limit) => (code === 124 ? `${what}: Zeitlimit von ${Math.round(limit / 60e3)} Minuten überschritten` : `${what} fehlgeschlagen (Exit-Code ${code})`);
@@ -342,7 +344,9 @@ export function createJobs({ config, docker, fs: fsOver = {}, git, mem = readMem
if (!out) problem = `Kein Ausgabeordner gefunden (gesucht: ${d.outputDirs.join(', ')})`;
}
if (problem) {
if (job.mode === 'auto' && d.devCmd && !d.explicitType) { onLine(`${problem} – Dev-Server wird verwendet`); run.result = 'dev'; }
const hasFolder = await fs.lstat(join(config.previewsRoot, job.sub)).then(() => true, () => false);
// Dev-Rueckfall nur beim ersten Deploy; mit bestehender Preview bleibt sie (V4) und das Routing auf nginx
if (job.mode === 'auto' && d.devCmd && !d.explicitType && !hasFolder) { onLine(`${problem} – Dev-Server wird verwendet`); run.result = 'dev'; }
else await fallbackOr(problem);
} else {
await publish(job, out, { skipGit: false, onLine });