realize repository
This commit is contained in:
parent
f569d07a84
commit
9ae6679bfd
1 changed files with 10 additions and 23 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue