diff --git a/src/main/python/ddadevops/domain/release_config.py b/src/main/python/ddadevops/domain/release_config.py new file mode 100644 index 0000000..f919aff --- /dev/null +++ b/src/main/python/ddadevops/domain/release_config.py @@ -0,0 +1,22 @@ +from typing import Optional +from .common import ( + filter_none, + Validateable, + Devops, +) + +class ReleaseConfig(Validateable): + def __init__( + self, + main_branch: str, + config_file: str, + devops: Devops, + release_version: str = None, + bump_version: str = None + ): + self.main_branch = main_branch + self.config_file = config_file + self.release_version = release_version + self.bump_version = bump_version + self.devops = devops + \ No newline at end of file diff --git a/src/main/python/ddadevops/infrastructure.py b/src/main/python/ddadevops/infrastructure.py index 196b076..d12569b 100644 --- a/src/main/python/ddadevops/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure.py @@ -4,7 +4,7 @@ from os import chmod from subprocess import run from pkg_resources import resource_string import yaml -from .domain import Devops, Image, C4k +from .domain import Devops, Image, C4k, ReleaseConfig from .python_util import execute @@ -30,6 +30,13 @@ class ProjectRepository: def set_c4k(self, project, build: C4k): project.set_property("c4k_build", build) + def get_release(self, project) -> ReleaseConfig: + return project.get_property("release_build") + + def set_release(self, project, build: ReleaseConfig): + project.set_property("release_build", build) + + class ResourceApi: def read_resource(self, path: str) -> bytes: