refactor so that coordinator instance is available in runner instance (#8)

-> all program states available

Reviewed-on: local-it-infrastructure/e2e_tests#8
Co-authored-by: Daniel <d.brummerloh@gmail.com>
Co-committed-by: Daniel <d.brummerloh@gmail.com>
This commit is contained in:
Daniel 2023-12-06 12:05:13 +01:00 committed by dan
parent f9c21c6e6b
commit 4c5a470a70
15 changed files with 74 additions and 53 deletions

View file

@ -46,7 +46,7 @@ class EnvManager:
for env_file in env_files:
child_runner_class = RUNNER_DICT[env_file.env_type]
for dependency in child_runner_class.dependencies:
dependency_rule = DependencyRule(child=child_runner_class.name, dependency=dependency)
dependency_rule = DependencyRule(child=child_runner_class.env_type, dependency=dependency)
dependency_rules.append(dependency_rule)
return dependency_rules
@ -93,8 +93,10 @@ class EnvManager:
)
def copy_env_files(self, DIR: DirManager) -> None:
"""Copies all env files to STATES/env_files. Files will be renamed to their own TYPE value."""
env_files_dir = DIR.STATES / "env_files"
env_files_dir.mkdir(exist_ok=True)
for env_file in self.env_files:
shutil.copy(env_file.env_path, env_files_dir / env_file.env_type)
"""Copies all env files to STATES/env_files. Files will be renamed to
<index>-<env_type>-<original_name>
00-authentik-login.test.dev.local-it.cloud.env"""
for index, env_file in enumerate(self.env_files):
file_name = "-".join([str(index).zfill(2), env_file.env_type, env_file.env_path.name])
shutil.copy(env_file.env_path, DIR.ENV_FILES / file_name)