WIP Implement prepare and tagandpush services

This commit is contained in:
erik 2023-02-22 11:34:27 +01:00
parent 821e06f82a
commit 1112b1ad49
2 changed files with 21 additions and 6 deletions

View file

@ -21,9 +21,14 @@ def initialize(project):
config = create_release_mixin_config(CONFIG_FILE, COMMIT_ID) config = create_release_mixin_config(CONFIG_FILE, COMMIT_ID)
build = MyBuild(project, config)
build.init() build = MyBuild(project, config)
release_version, bump_version = build.init()
build.prepare()
build.tag_and_push()
@task @task

View file

@ -3,6 +3,7 @@ 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 import Version
from version_repository import VersionRepository
def create_release_mixin_config(config, release_type, commit, file): def create_release_mixin_config(config, release_type, commit, file):
@ -16,14 +17,23 @@ class ReleaseMixin(DevopsBuild):
def __init__(self, project, config): def __init__(self, project, config):
super().__init__(project, config) super().__init__(project, config)
release_mixin_config = config['ReleaseMixin'] release_mixin_config = config['ReleaseMixin']
self.commit_id = release_mixin_config['commit_id']
self.file = release_mixin_config['file'] self.file = release_mixin_config['file']
self.version_repo = VersionRepository(self.file)
def init(self): def init(self): # returns versions
release_and_bump_version = InitReleaseService(self.commit_id, self.file).get_version() release_and_bump_version = InitReleaseService(self.version_repo).get_version()
return release_and_bump_version return release_and_bump_version
def prepare(self, version: Version): # writes into files, add. commit
pass
def tag_and_push(): # correct tag and do push
pass