From 570a31a9f951728dcf5d8d4e68940f2a99ac471d Mon Sep 17 00:00:00 2001 From: bom Date: Fri, 16 Dec 2022 15:04:32 +0100 Subject: [PATCH] Start implementation of c4k-mixin --- src/main/python/ddadevops/c4k_mixin.py | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/main/python/ddadevops/c4k_mixin.py diff --git a/src/main/python/ddadevops/c4k_mixin.py b/src/main/python/ddadevops/c4k_mixin.py new file mode 100644 index 0000000..1929cfa --- /dev/null +++ b/src/main/python/ddadevops/c4k_mixin.py @@ -0,0 +1,41 @@ +from string import Template +from subprocess import run +#from .python_util import * +#from .devops_build import DevopsBuild + +def add_c4k_mixin_config(config, + config_keys, + auth_keys, + c4k_config_template=None, + c4k_auth_template=None): + if c4k_config_template == None: + c4k_config_template = '{' + for key in config_keys: + c4k_config_template += f':{key} "${key}"\n' + c4k_config_template += '}' + if c4k_auth_template == None: + c4k_auth_template = '{' + for key in auth_keys: + c4k_auth_template += f':{key} "${key}"\n' + c4k_auth_template += '}' + + + + +#DevopsBuild +class C4kMixin(): + + def __init__(self, project, config): + super().__init__(project, config) + c4k_mixin_config = config['C4kMixin'] + + def write_c4k_config(self): + raise NotImplemented + + def write_c4k_auth(self): + raise NotImplemented + + def c4k_apply(self): + raise NotImplemented + +add_c4k_mixin_config({}, ['test', 'test2', 'fqdn'], [])