terraformDummyRepo/release_mixin.py

47 lines
1 KiB
Python
Raw Normal View History

2023-02-16 13:21:27 +00:00
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
2023-02-16 13:21:27 +00:00
2023-02-16 15:22:11 +00:00
def create_release_mixin_config(config, release_type, commit, file):
2023-02-16 13:21:27 +00:00
config.update({'ReleaseMixin':
2023-02-16 15:22:11 +00:00
{'commit_id': commit,
2023-02-16 13:21:27 +00:00
'file': file}})
return config
class ReleaseMixin(DevopsBuild):
def __init__(self, project, config):
super().__init__(project, config)
release_mixin_config = config['ReleaseMixin']
2023-02-16 13:21:27 +00:00
self.file = release_mixin_config['file']
self.version_repo = VersionRepository(self.file)
2023-02-16 13:21:27 +00:00
def init(self): # returns versions
release_and_bump_version = InitReleaseService(self.version_repo).get_version()
2023-02-16 15:22:11 +00:00
return release_and_bump_version
2023-02-16 13:21:27 +00:00
def prepare(self, version: Version): # writes into files, add. commit
pass
def tag_and_push(): # correct tag and do push
pass
2023-02-16 13:21:27 +00:00
2023-02-16 15:22:11 +00:00
2023-02-16 13:21:27 +00:00