mirror of
git://f0xx.org/ac/ac-ms-build
synced 2026-08-12 18:13:16 +03:00
Builder: fail early when build.log is not writable.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -142,6 +142,15 @@ YAML;
|
||||
return BuildRepository::getById($id) ?? ['id' => $id, 'build_code' => $buildCode, 'status' => 'failed'];
|
||||
}
|
||||
$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]);
|
||||
|
||||
if (!self::dockerAvailable()) {
|
||||
|
||||
Reference in New Issue
Block a user