Add hook deployment onCollect

This commit is contained in:
Mattia Codato 2021-04-20 14:23:42 +02:00 committed by Thomas Gelf
parent 04ba8d12cf
commit 9387ede99a
2 changed files with 18 additions and 0 deletions

View File

@ -677,6 +677,12 @@ constants
$deployment->set('stage_collected', 'y');
$deployment->store();
/** @var DeploymentHook[] $hooks */
$hooks = Hook::all('director/Deployment');
foreach ($hooks as $hook) {
$hook->onCollect($deployment);
}
}
foreach ($missing as $deployment) {

View File

@ -50,4 +50,16 @@ abstract class DeploymentHook
$this->onSuccessfulDump($deploymentLog);
$this->onSuccessfullDump($deploymentLog);
}
/**
* Please override this method if you want to trigger custom actions
* once success (or failure) information have been collected for a deployed
* stage. startup_succeeded will then be filled, and startup_log might be
* available
*
* @param DirectorDeploymentLog $deployment
*/
public function onCollect(DirectorDeploymentLog $deployment)
{
}
}