diff --git a/build.gradle b/build.gradle index 209a7c1..5d95929 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.3" 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 1e87167..c923fdf 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/DesktopService.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/DesktopService.kt @@ -40,8 +40,7 @@ fun Prov.provisionDesktopImpl( submodules: List? ) = 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, submodules) 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 {