diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index cbbe6ee9c3..163623241c 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -1218,13 +1218,22 @@ class Builds extends Action $message .= "\n" . $error; } + // Combine with previous logs if deployment got past build process + $previousLogs = ''; + if (!empty($deployment->getAttribute('buildEndedAt', ''))) { + $previousLogs = $deployment->getAttribute('buildLogs', ''); + if (!empty($previousLogs)) { + $message = $previousLogs . "\n" . $message; + } + } + $endTime = DateTime::now(); $durationEnd = \microtime(true); $deployment->setAttribute('buildEndedAt', $endTime); $deployment->setAttribute('buildDuration', \intval(\ceil($durationEnd - $durationStart))); $deployment->setAttribute('status', 'failed'); - $deployment->setAttribute('buildLogs', $deployment->getAttribute('buildLogs', '') . "\n" . $message); + $deployment->setAttribute('buildLogs', $message); $deployment = $dbForProject->updateDocument('deployments', $deploymentId, $deployment); if ($deployment->getInternalId() === $resource->getAttribute('latestDeploymentInternalId', '')) {