realize repository

This commit is contained in:
Michael Jerger 2023-05-10 08:53:05 +02:00
parent f569d07a84
commit 9ae6679bfd

View file

@ -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: