diff --git a/src/main/python/ddadevops/domain/__init__.py b/src/main/python/ddadevops/domain/__init__.py index d6b5a11..4bd528a 100644 --- a/src/main/python/ddadevops/domain/__init__.py +++ b/src/main/python/ddadevops/domain/__init__.py @@ -1,4 +1,4 @@ -from .common import Validateable, DnsRecord, Devops +from .common import Validateable, DnsRecord, Devops, BuildType from .devops_factory import DevopsFactory from .image import Image from .c4k import C4k diff --git a/src/main/python/ddadevops/domain/common.py b/src/main/python/ddadevops/domain/common.py index bc87184..5792765 100644 --- a/src/main/python/ddadevops/domain/common.py +++ b/src/main/python/ddadevops/domain/common.py @@ -7,6 +7,10 @@ import deprecation def filter_none(list_to_filter): return [x for x in list_to_filter if x is not None] +class BuildType(Enum): + IMAGE = 0 + C4K = 1 + class Validateable: def __validate_is_not_empty__(self, field_name: str) -> List[str]: value = self.__dict__[field_name] @@ -41,12 +45,13 @@ class DnsRecord(Validateable): class Devops(Validateable): - def __init__(self, input: dict, specialized_build: Validateable): + def __init__(self, input: dict, build_type: BuildType, specialized_build: Validateable): self.stage = input.get('stage') self.project_root_path = input.get('project_root_path') self.module = input.get('module') self.name = input.get('name', self.module) self.build_dir_name = input.get('build_dir_name', 'target') + self.build_type = build_type self.specialized_build=specialized_build def build_path(self): @@ -74,7 +79,3 @@ class Devops(Validateable): for key in keys: result[key] = self.__get(key) return result - -class BuildType(Enum): - IMAGE = 0 - C4K = 1 diff --git a/src/main/python/ddadevops/domain/devops_factory.py b/src/main/python/ddadevops/domain/devops_factory.py index 33f6857..3da7ea8 100644 --- a/src/main/python/ddadevops/domain/devops_factory.py +++ b/src/main/python/ddadevops/domain/devops_factory.py @@ -19,7 +19,9 @@ class DevopsFactory: elif build_type == BuildType.C4K: pass - devops = Devops(input, specialized_build=specialized_build) + devops = Devops( + input, build_type=build_type, specialized_build=specialized_build + ) devops.throw_if_invalid()