From 9ae6679bfd218e4b5f05f12fbdd8bf6b40f5c096 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 10 May 2023 08:53:05 +0200 Subject: [PATCH] realize repository --- .../infrastructure/infrastructure.py | 33 ++++++------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 300180f..dbbd98f 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -8,34 +8,21 @@ import deprecation from ..domain import Devops, Image, C4k, Release from ..python_util import execute +class DevopsRepository: + def get_devops(self, project) -> Devops: + devops = project.get_property("devops") + devops.throw_if_invalid() + return devops + + def set_devops(self, project, devops: Devops): + devops.throw_if_invalid() + project.set_property("devops", devops) + class ProjectRepository: def set_build(self, project, build): project.set_property("devops_build", build) - def get_devops(self, project) -> Devops: - return project.get_property("build") - - def set_devops(self, project, build: Devops): - project.set_property("build", build) - - @deprecation.deprecated(deprecated_in="3.2") - def get_c4k(self, project) -> C4k: - return project.get_property("c4k_build") - - @deprecation.deprecated(deprecated_in="3.2") - def set_c4k(self, project, build: C4k): - project.set_property("c4k_build", build) - - @deprecation.deprecated(deprecated_in="3.2") - def get_release(self, project) -> Release: - return project.get_property("release_build") - - @deprecation.deprecated(deprecated_in="3.2") - def set_release(self, project, build: Release): - project.set_property("release_build", build) - - class ResourceApi: def read_resource(self, path: str) -> bytes: