mob
This commit is contained in:
parent
4f499bd1f4
commit
74925a90b7
7 changed files with 33 additions and 20 deletions
|
@ -1,5 +1,12 @@
|
||||||
from release_type import ReleaseType
|
from enum import Enum
|
||||||
from file_handlers import FileHandler
|
|
||||||
|
class ReleaseType(Enum):
|
||||||
|
MAJOR = 0
|
||||||
|
MINOR = 1
|
||||||
|
PATCH = 2
|
||||||
|
SNAPSHOT = 3
|
||||||
|
BUMP = None
|
||||||
|
|
||||||
|
|
||||||
class Version():
|
class Version():
|
||||||
|
|
||||||
|
@ -19,11 +26,11 @@ class Version():
|
||||||
case ReleaseType.PATCH:
|
case ReleaseType.PATCH:
|
||||||
self.version_list[ReleaseType.PATCH.value] += 1
|
self.version_list[ReleaseType.PATCH.value] += 1
|
||||||
case ReleaseType.MINOR:
|
case ReleaseType.MINOR:
|
||||||
self.version_list[ReleaseType.PATCH.value] = 0
|
self.version_list[ReleaseType.PATCH.value] = 0
|
||||||
self.version_list[ReleaseType.MINOR.value] += 1
|
self.version_list[ReleaseType.MINOR.value] += 1
|
||||||
case ReleaseType.MAJOR:
|
case ReleaseType.MAJOR:
|
||||||
self.version_list[ReleaseType.PATCH.value] = 0
|
self.version_list[ReleaseType.PATCH.value] = 0
|
||||||
self.version_list[ReleaseType.MINOR.value] = 0
|
self.version_list[ReleaseType.MINOR.value] = 0
|
||||||
self.version_list[ReleaseType.MAJOR.value] += 1
|
self.version_list[ReleaseType.MAJOR.value] += 1
|
||||||
case None:
|
case None:
|
||||||
raise Exception("Release Type was not set!")
|
raise Exception("Release Type was not set!")
|
||||||
|
@ -33,15 +40,21 @@ class Version():
|
||||||
if self.is_snapshot:
|
if self.is_snapshot:
|
||||||
self.version_string += "-SNAPSHOT"
|
self.version_string += "-SNAPSHOT"
|
||||||
return self.version_string
|
return self.version_string
|
||||||
|
|
||||||
def create_release_version(self, release_type: ReleaseType):
|
def create_release_version(self, release_type: ReleaseType):
|
||||||
release_version = Version(self.version_list.copy())
|
release_version = Version(self.version_list.copy())
|
||||||
release_version.is_snapshot = self.is_snapshot
|
release_version.is_snapshot = self.is_snapshot
|
||||||
release_version.increment(release_type)
|
release_version.increment(release_type)
|
||||||
return release_version
|
return release_version
|
||||||
|
|
||||||
def create_bump_version(self):
|
def create_bump_version(self):
|
||||||
bump_version = Version(self.version_list.copy())
|
bump_version = Version(self.version_list.copy())
|
||||||
bump_version.is_snapshot = self.is_snapshot
|
bump_version.is_snapshot = self.is_snapshot
|
||||||
bump_version.increment(ReleaseType.BUMP)
|
bump_version.increment(ReleaseType.BUMP)
|
||||||
return bump_version
|
return bump_version
|
||||||
|
|
||||||
|
|
||||||
|
class Release():
|
||||||
|
def __init__(self, release_type: ReleaseType, version: Version):
|
||||||
|
self.release_type = release_type
|
||||||
|
self.version = version
|
|
@ -2,7 +2,7 @@ import os
|
||||||
import subprocess as sub
|
import subprocess as sub
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from system_repository import SystemRepository
|
from system_repository import SystemRepository
|
||||||
from release_type import ReleaseType
|
from domain import ReleaseType
|
||||||
|
|
||||||
class GitRepository():
|
class GitRepository():
|
||||||
|
|
||||||
|
|
8
infrastructure.py
Normal file
8
infrastructure.py
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
from domain import Release
|
||||||
|
|
||||||
|
class ReleaseRepository():
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def get_current_release(self) -> Release:
|
||||||
|
pass
|
|
@ -2,11 +2,10 @@ import copy
|
||||||
from ddadevops import DevopsBuild
|
from ddadevops import DevopsBuild
|
||||||
from ddadevops import execute
|
from ddadevops import execute
|
||||||
from ddadevops import gopass_field_from_path, gopass_password_from_path
|
from ddadevops import gopass_field_from_path, gopass_password_from_path
|
||||||
from version import Version
|
|
||||||
from version_repository import VersionRepository
|
from version_repository import VersionRepository
|
||||||
from services import InitReleaseService, PrepareReleaseService, TagAndPushReleaseService
|
from services import InitReleaseService, PrepareReleaseService, TagAndPushReleaseService
|
||||||
from git_repository import GitRepository
|
from git_repository import GitRepository
|
||||||
from release_type import ReleaseType
|
from domain import ReleaseType, Version
|
||||||
|
|
||||||
def create_release_mixin_config(config_file, main_branch) -> dict:
|
def create_release_mixin_config(config_file, main_branch) -> dict:
|
||||||
config = {}
|
config = {}
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
from enum import Enum
|
|
||||||
class ReleaseType(Enum):
|
|
||||||
MAJOR = 0
|
|
||||||
MINOR = 1
|
|
||||||
PATCH = 2
|
|
||||||
SNAPSHOT = 3
|
|
||||||
BUMP = None
|
|
|
@ -2,7 +2,7 @@ from pathlib import Path
|
||||||
from version_repository import VersionRepository
|
from version_repository import VersionRepository
|
||||||
from release_type import ReleaseType
|
from release_type import ReleaseType
|
||||||
from git_repository import GitRepository
|
from git_repository import GitRepository
|
||||||
from version import Version
|
from domain import Version
|
||||||
|
|
||||||
class InitReleaseService():
|
class InitReleaseService():
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from file_handlers import FileHandler
|
from file_handlers import FileHandler
|
||||||
from version import Version
|
from domain import Version
|
||||||
|
|
||||||
class VersionRepository():
|
class VersionRepository():
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue