Implement creation of release version

This commit is contained in:
erik 2023-02-20 14:45:15 +01:00
parent 91f3d7d972
commit eb998cfdbb
2 changed files with 15 additions and 14 deletions

View file

@ -3,7 +3,7 @@ class InitReleaseService():
def __init__(self, commit_id, file): def __init__(self, commit_id, file):
self.commit_id = commit_id self.commit_id = commit_id
self.file = file self.file = file
self.version_repo = none self.version_repo = None
def __read_commit_message(self): def __read_commit_message(self):
pass pass
@ -11,23 +11,24 @@ class InitReleaseService():
def __calculate_release_type(self): def __calculate_release_type(self):
pass pass
def get_version(self): def get_version_repo(self):
self.version_repo = VersionRepository.get(self.file)
version_repo = VersionRepository.get(self.file) def get_version_list(self):
commit_message = self.read_commit_message(self.commit_id) self.get_version_repo()
release_type = self.calculate_release_type(commit_message) return self.version_repo.version_list
release_version = create_release_version(version_repo.version_list, release_type)
bump_version = create_bump_version(version_repo.version_list, release_type)
release_and_bump_version = tuple(release_version, bump_version)
return release_and_bump_version
def create_release_version(self): def create_release_version(self):
pass commit_message = self.read_commit_message(self.commit_id)
release_type = self.calculate_release_type(commit_message)
version_list = self.get_version_list()
release_version = Version.create_release_version(version_list, release_type)
self.version_repo.write_file(release_version.get_version_string())
def create_bump_version(self): def create_bump_version(self):
bump_version = create_bump_version(version_repo.version_list, release_type)
pass pass

View file

@ -24,8 +24,8 @@ class Version():
def __init__(self, version_list, release_type): def __init__(self, version_list, release_type):
self.version_list = None self.version_list = None
self.is_snapshot = None
self.version_string = None self.version_string = None
self.is_snapshot = None
def increment(self, release_type: ReleaseType): def increment(self, release_type: ReleaseType):
self.is_snapshot = False self.is_snapshot = False