Merge pull request #9996 from appwrite/feat-after-build-hook

feat after build hook
This commit is contained in:
Christy Jacob 2025-06-11 21:16:01 +04:00 committed by GitHub
commit e267283fa9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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', []);