diff --git a/library/Director/Core/CoreApi.php b/library/Director/Core/CoreApi.php index c12296654..10c527dfa 100644 --- a/library/Director/Core/CoreApi.php +++ b/library/Director/Core/CoreApi.php @@ -845,17 +845,19 @@ public function dumpConfig(IcingaConfig $config, Db $db, $packageName = null) // 'username' => Util::getUsername(), // 'module_name' => $moduleName, )); + $files = $config->getFileContents(); /** @var DeploymentHook[] $hooks */ $hooks = Hook::all('director/Deployment'); foreach ($hooks as $hook) { $hook->beforeDeploy($deployment); + $files = $hook->beforeDump($files); } $this->assertPackageExists($packageName); $response = $this->client()->post('config/stages/' . \rawurlencode($packageName), [ - 'files' => $config->getFileContents() + 'files' => $files ]); $duration = (int) ((microtime(true) - $start) * 1000); diff --git a/library/Director/Hook/BeforeStoreIcingaObjectHook.php b/library/Director/Hook/BeforeStoreIcingaObjectHook.php new file mode 100644 index 000000000..04d19ce60 --- /dev/null +++ b/library/Director/Hook/BeforeStoreIcingaObjectHook.php @@ -0,0 +1,15 @@ +resolveUnresolvedRelatedProperties(); if ($this->gotImports()) { $this->imports()->getObjects();