mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
feat(builds): after build hook
This commit is contained in:
parent
0e17aeaa57
commit
0c8ae4f34f
1 changed files with 17 additions and 0 deletions
|
|
@ -877,6 +877,10 @@ class Builds extends Action
|
|||
}
|
||||
}
|
||||
|
||||
$deployment->setAttribute('buildLogs', $logs);
|
||||
|
||||
$this->afterBuildSuccess($dbForProject, $deployment);
|
||||
|
||||
$deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment);
|
||||
|
||||
$queueForRealtime
|
||||
|
|
@ -1313,6 +1317,19 @@ class Builds extends Action
|
|||
->trigger();
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook to run after build success
|
||||
*
|
||||
* @param Database $dbForProject
|
||||
* @param Document $deployment
|
||||
* @return void
|
||||
*/
|
||||
protected function afterBuildSuccess(Database $dbForProject, Document &$deployment): void
|
||||
{
|
||||
assert($dbForProject instanceof Database);
|
||||
assert($deployment instanceof Document);
|
||||
}
|
||||
|
||||
protected function getRuntime(Document $resource, string $version): array
|
||||
{
|
||||
$runtimes = Config::getParam($version === 'v2' ? 'runtimes-v2' : 'runtimes', []);
|
||||
|
|
|
|||
Loading…
Reference in a new issue