From 73849b3ef8c9df091fa5f99ff6b05ecb39d1d2fa Mon Sep 17 00:00:00 2001 From: tristan Date: Mon, 6 Apr 2026 15:23:39 +0200 Subject: [PATCH] feat : add DeployProcessor for triggering deployments Co-Authored-By: Claude Sonnet 4.6 --- src/State/DeployProcessor.php | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/State/DeployProcessor.php diff --git a/src/State/DeployProcessor.php b/src/State/DeployProcessor.php new file mode 100644 index 0000000..7e5af98 --- /dev/null +++ b/src/State/DeployProcessor.php @@ -0,0 +1,47 @@ +environmentRepository->find($id) : null; + + if (null === $environment) { + throw new NotFoundHttpException(sprintf('Environment "%s" not found.', $id)); + } + + $requestData = $context['request']?->toArray() ?? []; + $tag = $requestData['tag'] ?? null; + + if (null === $tag || '' === $tag) { + throw new BadRequestHttpException('The "tag" field is required.'); + } + + $result = $this->deployService->deploy($environment, $tag); + + $dto = new DeployResult(); + $dto->success = $result['success']; + $dto->output = $result['output']; + $dto->tag = $tag; + + return $dto; + } +}