mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge pull request #9996 from appwrite/feat-after-build-hook
feat after build hook
This commit is contained in:
@@ -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', []);
|
||||
|
||||
Reference in New Issue
Block a user