From a60b98c8a5f20ec1cd29c25102eb6e0c626d69cb Mon Sep 17 00:00:00 2001 From: see Date: Thu, 30 Jun 2022 14:00:57 +0200 Subject: [PATCH 1/5] Release, ToDos, Refactorings Cleanup todos and refactor some functions. This also removes some overloading. New release v0.12.1 --- build.gradle | 2 +- .../desktop/application/CliArgumentsParser.kt | 2 +- .../provs/desktop/domain/DesktopService.kt | 3 +-- .../provs/desktop/domain/DesktopType.kt | 2 +- .../provs/server/application/Application.kt | 2 -- .../provs/server/domain/k3s/K3sService.kt | 15 ++++++--------- 6 files changed, 10 insertions(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index 209a7c1..a4cc8cd 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ apply plugin: "kotlinx-serialization" group = "org.domaindrivenarchitecture.provs" -version = "0.12.1-SNAPSHOT" +version = "release-0.12.1" repositories { mavenCentral() diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/application/CliArgumentsParser.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/application/CliArgumentsParser.kt index b2a3605..4277c59 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/application/CliArgumentsParser.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/application/CliArgumentsParser.kt @@ -24,7 +24,7 @@ open class CliArgumentsParser(name: String) : CliTargetParser(name) { val module = modules.first { it.parsed } return DesktopCliCommand( - DesktopType.valueOf(module.name.uppercase()), + DesktopType.returnIfExists(module.name.uppercase()), TargetCliCommand( target, passwordInteractive diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/DesktopService.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/DesktopService.kt index f93b631..edcc71b 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/DesktopService.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/DesktopService.kt @@ -43,8 +43,7 @@ fun Prov.provisionDesktop( gitEmail: String? = null, ) = task { - // TODO: jem - 2022-06-30: why?? We got already a typed var! - DesktopType.valueOf(desktopType.name) // throws exception when desktopType.name is unknown + DesktopType.returnIfExists(desktopType.name) // throws exception when desktopType.name is unknown validatePrecondition() provisionBaseDesktop(gpg, ssh, gitUserName, gitEmail) diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/DesktopType.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/DesktopType.kt index 385b537..2f1b72c 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/DesktopType.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/DesktopType.kt @@ -17,7 +17,7 @@ open class DesktopType(val name: String) { @JvmStatic protected val values = listOf(BASIC, OFFICE, IDE) - fun valueOf(value: String, valueList: List = values): DesktopType { + fun returnIfExists(value: String, valueList: List = values): DesktopType { for (type in valueList) { if (value.uppercase().equals(type.name)) { return type diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/server/application/Application.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/server/application/Application.kt index 1da5368..a44de64 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/server/application/Application.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/server/application/Application.kt @@ -4,8 +4,6 @@ import org.domaindrivenarchitecture.provs.framework.core.cli.createProvInstance import org.domaindrivenarchitecture.provs.server.domain.ServerType import org.domaindrivenarchitecture.provs.server.domain.k3s.K3sCliCommand import org.domaindrivenarchitecture.provs.server.domain.k3s.provisionK3s -// TODO: jem - 2022-06-30: unused import -import org.domaindrivenarchitecture.provs.server.infrastructure.provisionServerCliConvenience import kotlin.system.exitProcess diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/server/domain/k3s/K3sService.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/server/domain/k3s/K3sService.kt index e09a71a..f5e8851 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/server/domain/k3s/K3sService.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/server/domain/k3s/K3sService.kt @@ -14,21 +14,17 @@ fun Prov.provisionK3s(cli: K3sCliCommand) = task { if (cli.submodules == null) { // full k3s val k3sConfig: K3sConfig = getK3sConfig(cli.configFileName) - provisionK3s(k3sConfig, grafanaConfigResolved, cli.applicationFileName) + provisionK3sWorker(k3sConfig, grafanaConfigResolved, cli.applicationFileName) } else { // submodules only - provisionMeissaDesktopSubmodules(cli.submodules, grafanaConfigResolved) + provisionGrafanaSanitized(cli.submodules, grafanaConfigResolved) } - - // TODO: jem - 2022-06-30: das hier ist auf der falschen Ebene - gehört doch eher in die methode unten - provisionServerCliConvenience() } /** * Installs a k3s server. */ -// TODO: jem - 2022-06-30: die überladenen methoden sind schwierig - lieber unterschiedlich benennen -fun Prov.provisionK3s( +fun Prov.provisionK3sWorker( k3sConfig: K3sConfig, grafanaConfigResolved: GrafanaAgentConfigResolved? = null, applicationFileName: ApplicationFileName? = null) = task { @@ -56,10 +52,11 @@ fun Prov.provisionK3s( if (applicationFileName != null) { provisionK3sApplication(applicationFileName) } + + provisionServerCliConvenience() } -// TODO: jem - 2022-06-30: warum heisst diese methode meissa? -private fun Prov.provisionMeissaDesktopSubmodules( +private fun Prov.provisionGrafanaSanitized( submodules: List, grafanaConfigResolved: GrafanaAgentConfigResolved?) = task { From a43ec39c2224cb8c16b92264241a732d1494aca3 Mon Sep 17 00:00:00 2001 From: see Date: Thu, 30 Jun 2022 14:11:32 +0200 Subject: [PATCH 2/5] [skip-ci] 0.12.2-SNAPSHOT --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index a4cc8cd..0a84349 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ apply plugin: "kotlinx-serialization" group = "org.domaindrivenarchitecture.provs" -version = "release-0.12.1" +version = "0.12.2-SNAPSHOT" repositories { mavenCentral() From f80d928cdbb246b98b09af0f28502bfe15d8cfb8 Mon Sep 17 00:00:00 2001 From: see Date: Thu, 30 Jun 2022 14:42:18 +0200 Subject: [PATCH 3/5] release-0.12.2 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 0a84349..6dd0faf 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ apply plugin: "kotlinx-serialization" group = "org.domaindrivenarchitecture.provs" -version = "0.12.2-SNAPSHOT" +version = "release-0.12.2" repositories { mavenCentral() From b914280664b061b9aa960d6af8be09e1ebea0810 Mon Sep 17 00:00:00 2001 From: see Date: Thu, 30 Jun 2022 14:43:24 +0200 Subject: [PATCH 4/5] [skip-ci] 0.12.3-SNAPSHOT --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 6dd0faf..5b89888 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ apply plugin: "kotlinx-serialization" group = "org.domaindrivenarchitecture.provs" -version = "release-0.12.2" +version = "0.12.3-SNAPSHOT" repositories { mavenCentral() From c8a11c21885834fdbe228e08f59be2da675d83aa Mon Sep 17 00:00:00 2001 From: see Date: Thu, 30 Jun 2022 15:20:02 +0200 Subject: [PATCH 5/5] release-0.12.3 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 5b89888..5d95929 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ apply plugin: "kotlinx-serialization" group = "org.domaindrivenarchitecture.provs" -version = "0.12.3-SNAPSHOT" +version = "release-0.12.3" repositories { mavenCentral()