1
0
mirror of git://f0xx.org/ac/ac-be-builder synced 2026-08-12 18:12:50 +03:00

Builder: fail early when build.log is not writable.

Avoid silent runner start when deploy reset builds/ ownership to nginx.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Anton Afanasyeu
2026-08-09 11:03:38 +02:00
parent 08747faf82
commit ef6718a5f2

View File

@@ -142,6 +142,15 @@ YAML;
return BuildRepository::getById($id) ?? ['id' => $id, 'build_code' => $buildCode, 'status' => 'failed']; return BuildRepository::getById($id) ?? ['id' => $id, 'build_code' => $buildCode, 'status' => 'failed'];
} }
$logPath = $dir . '/build.log'; $logPath = $dir . '/build.log';
if (@file_put_contents($logPath, "[builder] Build queued\n", FILE_APPEND) === false) {
self::failBuild(
$id,
'Cannot write build log: ' . $logPath
. ' (run prepare-be-builder-dirs.sh; builds/ must be writable by PHP-FPM user nobody)',
null
);
return BuildRepository::getById($id) ?? ['id' => $id, 'build_code' => $buildCode, 'status' => 'failed'];
}
BuildRepository::update($id, ['log_path' => $logPath]); BuildRepository::update($id, ['log_path' => $logPath]);
if (!self::dockerAvailable()) { if (!self::dockerAvailable()) {