Refactor to C4kBuild
This commit is contained in:
parent
79de907396
commit
7e23080cff
3 changed files with 5 additions and 7 deletions
|
@ -9,7 +9,7 @@ from .provs_k3s_mixin import ProvsK3sMixin, add_provs_k3s_mixin_config
|
||||||
from .aws_rds_pg_mixin import AwsRdsPgMixin, add_aws_rds_pg_mixin_config
|
from .aws_rds_pg_mixin import AwsRdsPgMixin, add_aws_rds_pg_mixin_config
|
||||||
from .aws_mfa_mixin import AwsMfaMixin, add_aws_mfa_mixin_config
|
from .aws_mfa_mixin import AwsMfaMixin, add_aws_mfa_mixin_config
|
||||||
from .aws_backend_properties_mixin import AwsBackendPropertiesMixin, add_aws_backend_properties_mixin_config
|
from .aws_backend_properties_mixin import AwsBackendPropertiesMixin, add_aws_backend_properties_mixin_config
|
||||||
from .c4k_mixin import C4kMixin, add_c4k_mixin_config
|
from .c4k_mixin import C4kBuild, add_c4k_mixin_config
|
||||||
from .exoscale_mixin import ExoscaleMixin, add_exoscale_mixin_config
|
from .exoscale_mixin import ExoscaleMixin, add_exoscale_mixin_config
|
||||||
from .digitalocean_backend_properties_mixin import DigitaloceanBackendPropertiesMixin, add_digitalocean_backend_properties_mixin_config
|
from .digitalocean_backend_properties_mixin import DigitaloceanBackendPropertiesMixin, add_digitalocean_backend_properties_mixin_config
|
||||||
from .digitalocean_terraform_build import DigitaloceanTerraformBuild, create_digitalocean_terraform_build_config
|
from .digitalocean_terraform_build import DigitaloceanTerraformBuild, create_digitalocean_terraform_build_config
|
||||||
|
|
|
@ -44,9 +44,7 @@ def add_c4k_mixin_config(
|
||||||
)
|
)
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
class C4kBuild(DevopsBuild):
|
||||||
#TODO: refactor this to C4kBuild
|
|
||||||
class C4kMixin(DevopsBuild):
|
|
||||||
def __init__(self, project, config):
|
def __init__(self, project, config):
|
||||||
super().__init__(project, config)
|
super().__init__(project, config)
|
||||||
self.execution_api = ExecutionApi()
|
self.execution_api = ExecutionApi()
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import os
|
import os
|
||||||
from pybuilder.core import Project
|
from pybuilder.core import Project
|
||||||
from src.main.python.ddadevops.domain import DnsRecord
|
from src.main.python.ddadevops.domain import DnsRecord
|
||||||
from src.main.python.ddadevops.c4k_mixin import C4kMixin, add_c4k_mixin_config
|
from src.main.python.ddadevops.c4k_mixin import C4kBuild, add_c4k_mixin_config
|
||||||
|
|
||||||
class MyC4kMixin(C4kMixin):
|
class MyC4kBuild(C4kBuild):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_c4k_mixin(tmp_path):
|
def test_c4k_mixin(tmp_path):
|
||||||
|
@ -29,7 +29,7 @@ def test_c4k_mixin(tmp_path):
|
||||||
|
|
||||||
assert project_config.get('C4kMixin') is not None
|
assert project_config.get('C4kMixin') is not None
|
||||||
|
|
||||||
mixin = MyC4kMixin(project, project_config)
|
mixin = MyC4kBuild(project, project_config)
|
||||||
mixin.initialize_build_dir()
|
mixin.initialize_build_dir()
|
||||||
assert mixin.build_path() == f'{tmp_path_str}/{build_dir}/{project_name}/{module_name}'
|
assert mixin.build_path() == f'{tmp_path_str}/{build_dir}/{project_name}/{module_name}'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue