1
0
Fork 0
mirror of synced 2024-06-01 18:39:57 +12:00
This commit is contained in:
Bradley Schofield 2022-01-31 11:29:31 +00:00
parent f3e97e4133
commit 8e639d4f5f
2 changed files with 25 additions and 0 deletions

View file

@ -675,6 +675,13 @@ App::get('/v1/functions/:functionId/deployments')
$results = $dbForProject->find('deployments', $queries, $limit, $offset, [], [$orderType], $cursorDeployment ?? null, $cursorDirection);
$sum = $dbForProject->count('deployments', $queries, APP_LIMIT_COUNT);
foreach ($results as $result) {
$build = $dbForProject->getDocument('builds', $result->getAttribute('buildId'));
$result->setAttribute('status', $build->getAttribute('status', 'pending'));
$result->setAttribute('buildStderr', $build->getAttribute('stderr', ''));
$result->setAttribute('buildStdout', $build->getAttribute('stdout', ''));
}
$response->dynamic(new Document([
'deployments' => $results,
'sum' => $sum,

View file

@ -58,6 +58,24 @@ class Deployment extends Model
'default' => false,
'example' => true,
])
->addRule('status', [
'type' => self::TYPE_STRING,
'description' => 'The deployment status.',
'default' => '',
'example' => 'enabled',
])
->addRule('buildStdout', [
'type' => self::TYPE_STRING,
'description' => 'The build stdout.',
'default' => '',
'example' => 'enabled',
])
->addRule('buildStderr', [
'type' => self::TYPE_STRING,
'description' => 'The build stderr.',
'default' => '',
'example' => 'enabled',
])
;
}