From bf8fef87c79ef7134bc70fda457d5196f523d4d5 Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 19 Apr 2023 11:39:51 +0200 Subject: [PATCH] DDD Refactor: Move release to domain Merge release_config and release. Make imports available. --- src/main/python/ddadevops/domain/__init__.py | 2 +- .../domain.py => domain/release.py} | 22 +++++++++++++++++-- .../python/ddadevops/domain/release_config.py | 22 ------------------- .../ddadevops/release_mixin/__init__.py | 0 4 files changed, 21 insertions(+), 25 deletions(-) rename src/main/python/ddadevops/{release_mixin/domain.py => domain/release.py} (85%) delete mode 100644 src/main/python/ddadevops/domain/release_config.py delete mode 100644 src/main/python/ddadevops/release_mixin/__init__.py diff --git a/src/main/python/ddadevops/domain/__init__.py b/src/main/python/ddadevops/domain/__init__.py index f6bf5e2..8eaba18 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 .image import Image from .c4k import C4k -from .release_config import ReleaseConfig \ No newline at end of file +from .release import Release, ReleaseConfig, ReleaseType, Version, EnvironmentKeys \ No newline at end of file diff --git a/src/main/python/ddadevops/release_mixin/domain.py b/src/main/python/ddadevops/domain/release.py similarity index 85% rename from src/main/python/ddadevops/release_mixin/domain.py rename to src/main/python/ddadevops/domain/release.py index 4ad8822..8d57dfb 100644 --- a/src/main/python/ddadevops/release_mixin/domain.py +++ b/src/main/python/ddadevops/domain/release.py @@ -1,6 +1,10 @@ -# TODO: jem, zam - 2023_04_18: Mv this to src/main/python/ddadevops/domain/release.py from enum import Enum from pathlib import Path +from .common import ( + filter_none, + Validateable, + Devops, +) class ReleaseType(Enum): MAJOR = 0 @@ -58,7 +62,21 @@ class Version(): bump_version.increment(ReleaseType.BUMP) return bump_version -# TODO: jem, zam - 2023_04_18: xtend abstract validateable +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 + class Release(): def __init__(self, release_type: ReleaseType, version: Version, current_branch: str): self.release_type = release_type diff --git a/src/main/python/ddadevops/domain/release_config.py b/src/main/python/ddadevops/domain/release_config.py deleted file mode 100644 index f919aff..0000000 --- a/src/main/python/ddadevops/domain/release_config.py +++ /dev/null @@ -1,22 +0,0 @@ -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/release_mixin/__init__.py b/src/main/python/ddadevops/release_mixin/__init__.py deleted file mode 100644 index e69de29..0000000