Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
46cd2af19e
6 changed files with 10 additions and 16 deletions
|
@ -18,7 +18,7 @@ apply plugin: "kotlinx-serialization"
|
|||
|
||||
|
||||
group = "org.domaindrivenarchitecture.provs"
|
||||
version = "0.12.1-SNAPSHOT"
|
||||
version = "release-0.12.3"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -40,8 +40,7 @@ fun Prov.provisionDesktopImpl(
|
|||
submodules: List<String>?
|
||||
) = 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)
|
||||
|
|
|
@ -17,7 +17,7 @@ open class DesktopType(val name: String) {
|
|||
@JvmStatic
|
||||
protected val values = listOf(BASIC, OFFICE, IDE)
|
||||
|
||||
fun valueOf(value: String, valueList: List<DesktopType> = values): DesktopType {
|
||||
fun returnIfExists(value: String, valueList: List<DesktopType> = values): DesktopType {
|
||||
for (type in valueList) {
|
||||
if (value.uppercase().equals(type.name)) {
|
||||
return type
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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<String>,
|
||||
grafanaConfigResolved: GrafanaAgentConfigResolved?) = task {
|
||||
|
||||
|
|
Loading…
Reference in a new issue