refactor: *.k3s -> server

This commit is contained in:
jem 2022-01-18 20:10:18 +01:00
parent 1cdc05f352
commit b06b9ab8a2
45 changed files with 82 additions and 80 deletions

View file

@ -1,7 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="cli-MyIdeConfig.yaml" type="Application" factoryName="Application">
<option name="ALTERNATIVE_JRE_PATH" value="Kotlin SDK" />
<option name="MAIN_CLASS_NAME" value="org.domaindrivenarchitecture.provs.workplace.application.CliKt" />
<option name="MAIN_CLASS_NAME" value="org.domaindrivenarchitecture.provs.desktop.application.CliKt" />
<module name="provs.main" />
<option name="PROGRAM_PARAMETERS" value="MyIdeConfig.yaml" />
<method v="2">

View file

@ -1,8 +1,8 @@
package org.domaindrivenarchitecture.provs.workplace.application
package org.domaindrivenarchitecture.provs.desktop.application
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.workplace.domain.provisionWorkplace
import org.domaindrivenarchitecture.provs.workplace.domain.WorkplaceConfig
import org.domaindrivenarchitecture.provs.desktop.domain.provisionWorkplace
import org.domaindrivenarchitecture.provs.desktop.domain.WorkplaceConfig
/**
* Use case for provisioning a workplace

View file

@ -1,8 +1,8 @@
package org.domaindrivenarchitecture.provs.workplace.application
package org.domaindrivenarchitecture.provs.desktop.application
import kotlinx.serialization.SerializationException
import org.domaindrivenarchitecture.provs.framework.core.cli.createProvInstance
import org.domaindrivenarchitecture.provs.workplace.infrastructure.getConfig
import org.domaindrivenarchitecture.provs.desktop.infrastructure.getConfig
import java.io.FileNotFoundException
import kotlin.system.exitProcess

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.application
package org.domaindrivenarchitecture.provs.desktop.application
import org.domaindrivenarchitecture.provs.framework.core.cli.TargetCliCommand

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.application
package org.domaindrivenarchitecture.provs.desktop.application
import kotlinx.cli.ArgType
import kotlinx.cli.optional

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.domain
package org.domaindrivenarchitecture.provs.desktop.domain
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.core.ProvResult
@ -11,7 +11,7 @@ import org.domaindrivenarchitecture.provs.framework.ubuntu.keys.base.gpgFingerpr
import org.domaindrivenarchitecture.provs.framework.ubuntu.keys.provisionKeys
import org.domaindrivenarchitecture.provs.framework.ubuntu.user.base.currentUserCanSudo
import org.domaindrivenarchitecture.provs.framework.ubuntu.user.base.whoami
import org.domaindrivenarchitecture.provs.workplace.infrastructure.*
import org.domaindrivenarchitecture.provs.desktop.infrastructure.*
/**

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.domain
package org.domaindrivenarchitecture.provs.desktop.domain
import org.domaindrivenarchitecture.provs.framework.ubuntu.keys.KeyPairSource
import kotlinx.serialization.Serializable

View file

@ -0,0 +1,5 @@
package org.domaindrivenarchitecture.provs.desktop.domain
enum class WorkplaceType {
MINIMAL, OFFICE, IDE
}

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.core.ProvResult

View file

@ -1,9 +1,9 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import com.charleskorn.kaml.Yaml
import kotlinx.serialization.json.Json
import org.domaindrivenarchitecture.provs.framework.core.tags.Api
import org.domaindrivenarchitecture.provs.workplace.domain.WorkplaceConfig
import org.domaindrivenarchitecture.provs.desktop.domain.WorkplaceConfig
import java.io.BufferedReader
import java.io.FileReader
import java.io.FileWriter

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.core.ProvResult

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.aptInstall

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.createDir

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.core.ProvResult

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.core.ProvResult

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import org.domaindrivenarchitecture.provs.framework.core.Prov

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.addTextToFile

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
val KEY_MANAGEMENT = "ssh gnupg"

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.core.ProvResult

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.createDir

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.core.ProvResult

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.core.ProvResult

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.core.ProvResult

View file

@ -1,13 +0,0 @@
package org.domaindrivenarchitecture.provs.framework.extensions.server_software.k3s.application
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.extensions.server_software.k3s.domain.installK3sServer
/**
* Performs use case of provisioning a k3s server
*/
fun Prov.provisionK3s() = task {
installK3sServer()
}

View file

@ -1,11 +1,11 @@
package org.domaindrivenarchitecture.provs.framework.extensions.server_software.k3s.infrastructure.apple
package org.domaindrivenarchitecture.provs.server.apple
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.core.ProvResult
import org.domaindrivenarchitecture.provs.framework.core.remote
import org.domaindrivenarchitecture.provs.framework.core.repeatTaskUntilSuccess
import org.domaindrivenarchitecture.provs.framework.extensions.server_software.k3s.domain.applyK3sConfig
import org.domaindrivenarchitecture.provs.framework.extensions.server_software.k3s.domain.installK3sServer
import org.domaindrivenarchitecture.provs.server.domain.applyK3sConfig
import org.domaindrivenarchitecture.provs.server.domain.installK3sServer
/**

View file

@ -0,0 +1,13 @@
package org.domaindrivenarchitecture.provs.server.application
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.server.domain.installK3sServer
/**
* Performs use case of provisioning a k3s server
*/
fun Prov.provisionK3s() = task {
installK3sServer()
}

View file

@ -1,7 +1,7 @@
package org.domaindrivenarchitecture.provs.framework.extensions.server_software.k3s.application
package org.domaindrivenarchitecture.provs.server.application
import org.domaindrivenarchitecture.provs.framework.core.cli.createProvInstance
import org.domaindrivenarchitecture.provs.framework.extensions.server_software.k3s.domain.installK3sAsContainers
import org.domaindrivenarchitecture.provs.server.domain.installK3sAsContainers
import kotlin.system.exitProcess

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.framework.extensions.server_software.k3s.application
package org.domaindrivenarchitecture.provs.server.application
import kotlinx.cli.ArgType
import kotlinx.cli.default

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.framework.extensions.server_software.k3s.application
package org.domaindrivenarchitecture.provs.server.application
import org.domaindrivenarchitecture.provs.framework.core.cli.TargetCliCommand

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.framework.extensions.server_software.k3s.domain
package org.domaindrivenarchitecture.provs.server.domain
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.core.docker.provideContainer

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.framework.extensions.server_software.k3s.domain
package org.domaindrivenarchitecture.provs.server.domain
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.core.ProvResult

View file

@ -1,5 +0,0 @@
package org.domaindrivenarchitecture.provs.workplace.domain
enum class WorkplaceType {
MINIMAL, OFFICE, IDE
}

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.application
package org.domaindrivenarchitecture.provs.desktop.application
import ch.qos.logback.classic.Level
import io.mockk.every
@ -8,12 +8,11 @@ import io.mockk.verify
import org.domaindrivenarchitecture.provs.framework.core.*
import org.domaindrivenarchitecture.provs.framework.core.cli.retrievePassword
import org.domaindrivenarchitecture.provs.framework.core.processors.PrintOnlyProcessor
import org.domaindrivenarchitecture.provs.framework.core.*
import org.domaindrivenarchitecture.provs.test.setRootLoggingLevel
import org.domaindrivenarchitecture.provs.workplace.domain.WorkplaceConfig
import org.domaindrivenarchitecture.provs.workplace.domain.WorkplaceType
import org.domaindrivenarchitecture.provs.workplace.domain.provisionWorkplace
import org.domaindrivenarchitecture.provs.workplace.infrastructure.getConfig
import org.domaindrivenarchitecture.provs.desktop.domain.WorkplaceConfig
import org.domaindrivenarchitecture.provs.desktop.domain.WorkplaceType
import org.domaindrivenarchitecture.provs.desktop.domain.provisionWorkplace
import org.domaindrivenarchitecture.provs.desktop.infrastructure.getConfig
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.BeforeAll

View file

@ -1,8 +1,8 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import com.charleskorn.kaml.InvalidPropertyValueException
import org.domaindrivenarchitecture.provs.framework.ubuntu.secret.SecretSourceType
import org.domaindrivenarchitecture.provs.workplace.domain.WorkplaceType
import org.domaindrivenarchitecture.provs.desktop.domain.WorkplaceType
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import org.domaindrivenarchitecture.provs.framework.core.getResourceAsText
import org.domaindrivenarchitecture.provs.test.defaultTestContainer

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import org.domaindrivenarchitecture.provs.test.defaultTestContainer
import org.domaindrivenarchitecture.provs.test.tags.ContainerTest

View file

@ -1,4 +1,4 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
package org.domaindrivenarchitecture.provs.desktop.infrastructure
import org.domaindrivenarchitecture.provs.test.defaultTestContainer
import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.aptInstall

View file

@ -2,9 +2,9 @@ package org.domaindrivenarchitecture.provs.framework.extensions.workplace
import org.domaindrivenarchitecture.provs.test.defaultTestContainer
import org.domaindrivenarchitecture.provs.test.tags.ContainerTest
import org.domaindrivenarchitecture.provs.workplace.domain.WorkplaceType
import org.domaindrivenarchitecture.provs.workplace.domain.provisionWorkplace
import org.domaindrivenarchitecture.provs.workplace.infrastructure.getConfig
import org.domaindrivenarchitecture.provs.desktop.domain.WorkplaceType
import org.domaindrivenarchitecture.provs.desktop.domain.provisionWorkplace
import org.domaindrivenarchitecture.provs.desktop.infrastructure.getConfig
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test

View file

@ -2,7 +2,7 @@ package org.domaindrivenarchitecture.provs.framework.extensions.workplace.base
import org.domaindrivenarchitecture.provs.test.defaultTestContainer
import org.domaindrivenarchitecture.provs.test.tags.ContainerTest
import org.domaindrivenarchitecture.provs.workplace.infrastructure.installFakturama
import org.domaindrivenarchitecture.provs.desktop.infrastructure.installFakturama
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test

View file

@ -17,10 +17,10 @@ import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test
import org.domaindrivenarchitecture.provs.framework.extensions.test_keys.privateGPGSnakeoilKey
import org.domaindrivenarchitecture.provs.framework.extensions.test_keys.publicGPGSnakeoilKey
import org.domaindrivenarchitecture.provs.workplace.infrastructure.configureGopassBridgeJsonApi
import org.domaindrivenarchitecture.provs.workplace.infrastructure.downloadGopassBridge
import org.domaindrivenarchitecture.provs.workplace.infrastructure.installGopass
import org.domaindrivenarchitecture.provs.workplace.infrastructure.installGopassBridgeJsonApi
import org.domaindrivenarchitecture.provs.desktop.infrastructure.configureGopassBridgeJsonApi
import org.domaindrivenarchitecture.provs.desktop.infrastructure.downloadGopassBridge
import org.domaindrivenarchitecture.provs.desktop.infrastructure.installGopass
import org.domaindrivenarchitecture.provs.desktop.infrastructure.installGopassBridgeJsonApi
internal class GopassBridgeKtTest {

View file

@ -15,7 +15,7 @@ import org.junit.jupiter.api.Test
import org.domaindrivenarchitecture.provs.framework.extensions.test_keys.privateGPGSnakeoilKey
import org.domaindrivenarchitecture.provs.framework.extensions.test_keys.publicGPGSnakeoilKey
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.*
import org.domaindrivenarchitecture.provs.workplace.infrastructure.*
import org.domaindrivenarchitecture.provs.desktop.infrastructure.*
import org.junit.jupiter.api.Assertions.assertFalse

View file

@ -5,7 +5,7 @@ import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.domaindrivenarchitecture.provs.test.defaultTestContainer
import org.domaindrivenarchitecture.provs.workplace.infrastructure.installVSC
import org.domaindrivenarchitecture.provs.desktop.infrastructure.installVSC
internal class VSCodeKtTest {

View file

@ -1,5 +1,7 @@
package org.domaindrivenarchitecture.provs.framework.extensions.server_software.k3s.application
package org.domaindrivenarchitecture.provs.server.application
import org.domaindrivenarchitecture.provs.server.application.CliK3sArgumentsParser
import org.domaindrivenarchitecture.provs.server.application.parseServerArguments
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.Assertions.*

View file

@ -1,5 +1,6 @@
package org.domaindrivenarchitecture.provs.framework.extensions.server_software.k3s.application
package org.domaindrivenarchitecture.provs.server.application
import org.domaindrivenarchitecture.provs.server.application.main
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test

View file

@ -1,12 +1,12 @@
package org.domaindrivenarchitecture.provs.framework.extensions.server_software.k3s.domain
package org.domaindrivenarchitecture.provs.server.domain
import org.domaindrivenarchitecture.provs.framework.core.docker
import org.domaindrivenarchitecture.provs.framework.core.docker.containerExec
import org.domaindrivenarchitecture.provs.framework.core.docker.provideContainer
import org.domaindrivenarchitecture.provs.framework.core.local
import org.domaindrivenarchitecture.provs.framework.core.processors.ContainerStartMode
import org.domaindrivenarchitecture.provs.framework.extensions.server_software.k3s.infrastructure.apple.appleConfig
import org.domaindrivenarchitecture.provs.framework.extensions.server_software.k3s.infrastructure.apple.checkAppleService
import org.domaindrivenarchitecture.provs.server.apple.appleConfig
import org.domaindrivenarchitecture.provs.server.apple.checkAppleService
import org.domaindrivenarchitecture.provs.test.tags.ContainerTest
import org.domaindrivenarchitecture.provs.test.tags.NonCi
import org.junit.jupiter.api.Assertions.assertTrue