dda-devops-build/doc/architecture/BuildAndMixins.md

105 lines
2.5 KiB
Markdown
Raw Normal View History

2023-04-14 15:15:17 +00:00
# Overview of Build and Mixins
* Build can be used standalone
* Mixin can be added to Build
2023-03-12 15:55:15 +00:00
```mermaid
classDiagram
class DevopsBuild {
name()
build_path()
initialize_build_dir()
}
2023-04-14 15:15:17 +00:00
2023-03-12 15:55:15 +00:00
class DevopsTerraformBuild {
terraform_build_commons_path()
project_vars()
copy_build_resource_file_from_package(name)
copy_build_resources_from_package()
copy_build_resources_from_dir()
copy_local_state()
rescue_local_state()
initialize_build_dir()
post_build()
init_client()
write_output(terraform)
read_output_json()
plan()
plan_fail_on_diff()
apply(auto_approve=False)
refresh()
destroy(auto_approve=False)
tf_import(tf_import_name, tf_import_resource,)
print_terraform_command(terraform)
}
class HetznerMixin {
// HetznerMixin -> HetznerTerraformBuild
project_vars()
copy_build_resources_from_package()
}
class ExoscaleMixin {
// ExoscaleMixin -> ExoscaleTerraformBuild
project_vars()
copy_build_resources_from_package()
}
class AwsBackendPropertiesMixin {
def project_vars()
copy_build_resources_from_package()
init_client()
}
class DigitaloceanBackendPropertiesMixin {
project_vars(self)
copy_build_resources_from_package(self)
init_client(self)
}
class DevopsImageBuild {
2023-03-12 15:55:15 +00:00
def initialize_build_dir()
image()
drun()
dockerhub_login()
dockerhub_publish()
test()
}
2023-04-14 15:15:17 +00:00
class ReleaseMixin {
prepare_release()
tag_and_push_release()
}
2023-03-12 15:55:15 +00:00
class ProvsK3sMixin {
// ProvsK3sMixin -> ProvsK3sBuild
def update_runtime_config(fqdn, ipv4, ipv6=None)
write_provs_config()
provs_apply(dry_run=False)
}
class C4kMixin {
2023-03-14 14:07:47 +00:00
// C4kMixin -> C4k
2023-03-12 15:55:15 +00:00
def write_c4k_config()
def write_c4k_auth()
c4k_apply(dry_run=False)
}
DevopsBuild <|-- DevopsImageBuild
2023-03-12 15:55:15 +00:00
DevopsBuild <|-- DevopsTerraformBuild
DevopsBuild <|-- AwsRdsPgMixin
2023-04-14 15:15:17 +00:00
DevopsBuild <|-- ReleaseMixin
2023-03-12 15:55:15 +00:00
DevopsTerraformBuild <|-- AwsBackendPropertiesMixin
DevopsTerraformBuild <|-- DigitaloceanTerraformBuild
DevopsTerraformBuild <|--ExoscaleMixin
DevopsTerraformBuild <|--HetznerMixin
DevopsBuild <|-- ProvsK3sMixin
DigitaloceanTerraformBuild <|-- DigitaloceanBackendPropertiesMixin
AwsBackendPropertiesMixin <|-- AwsMfaMixin
DevopsBuild <|-- C4kMixin
```