terraformDummyRepo/release_mixin.py

46 lines
1 KiB
Python

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):
config.update({'ReleaseMixin':
{'commit_id': commit,
'file': file}})
return config
class ReleaseMixin(DevopsBuild):
def __init__(self, project, config):
super().__init__(project, config)
release_mixin_config = config['ReleaseMixin']
self.file = release_mixin_config['file']
self.version_repo = VersionRepository(self.file)
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