From 1112b1ad4902f098feefb8c90221276ced8efacb Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 22 Feb 2023 11:34:27 +0100 Subject: [PATCH] WIP Implement prepare and tagandpush services --- build.py | 9 +++++++-- release_mixin.py | 18 ++++++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 91d74dc..9e4d198 100644 --- a/build.py +++ b/build.py @@ -21,9 +21,14 @@ def initialize(project): 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 diff --git a/release_mixin.py b/release_mixin.py index f83a49f..9b8a5d2 100644 --- a/release_mixin.py +++ b/release_mixin.py @@ -3,6 +3,7 @@ from ddadevops import DevopsBuild from ddadevops import execute from ddadevops import gopass_field_from_path, gopass_password_from_path from version import Version +from version_repository import VersionRepository def create_release_mixin_config(config, release_type, commit, file): @@ -16,14 +17,23 @@ class ReleaseMixin(DevopsBuild): def __init__(self, project, config): super().__init__(project, config) - release_mixin_config = config['ReleaseMixin'] - self.commit_id = release_mixin_config['commit_id'] + release_mixin_config = config['ReleaseMixin'] self.file = release_mixin_config['file'] + self.version_repo = VersionRepository(self.file) - def init(self): - release_and_bump_version = InitReleaseService(self.commit_id, self.file).get_version() + def init(self): # returns versions + release_and_bump_version = InitReleaseService(self.version_repo).get_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 + + + +