diff --git a/app/http.php b/app/http.php index f670c64..c0dc040 100644 --- a/app/http.php +++ b/app/http.php @@ -625,6 +625,7 @@ function cleanUp(Orchestration $orchestration, Table $activeRuntimes, array $net $tmpBuild = "/{$tmpFolder}builds/code.tar.gz"; $tmpLogging = "/{$tmpFolder}logging"; // Build logs $tmpLogs = "/{$tmpFolder}logs"; // Runtime logs + $tmpBuildOutput = "/{$tmpFolder}buildOutput"; // Build output $sourceDevice = getStorageDevice("/"); $localDevice = new Local(); @@ -704,6 +705,7 @@ function cleanUp(Orchestration $orchestration, Table $activeRuntimes, array $net if ($version === 'v5') { $volumes[] = \dirname($tmpLogs . '/logs') . ':/mnt/logs:rw'; $volumes[] = \dirname($tmpLogging . '/logging') . ':/tmp/logging:rw'; + $volumes[] = \dirname($tmpBuildOutput) . ':/usr/local/build:rw'; } /** Keep the container alive if we have commands to be executed */ @@ -766,6 +768,10 @@ function cleanUp(Orchestration $orchestration, Table $activeRuntimes, array $net ]; } } catch (Throwable $err) { + if ($version !== 'v2') { + $output = Logs::get($runtimeName); + } + throw new Exception($err->getMessage(), 400); } } @@ -833,12 +839,6 @@ function cleanUp(Orchestration $orchestration, Table $activeRuntimes, array $net 'timestamp' => Logs::getTimestamp(), 'content' => $message ]; - } else { - $output = Logs::get($runtimeName); - $output = \count($output) > 0 ? $output : [ - 'timestamp' => Logs::getTimestamp(), - 'content' => $th->getMessage() - ]; } $localDevice->deletePath($tmpFolder);