refactoring workplace Application.kt & improve CliApplication.puml

This commit is contained in:
ansgarz 2021-12-15 19:41:36 +01:00
parent c78ea3b432
commit acfc5ae753
3 changed files with 6 additions and 6 deletions

View file

@ -52,8 +52,8 @@ WorkplaceConfig <- ConfigRepository : create
WorkplaceConfig --> ConfigRepository : config WorkplaceConfig --> ConfigRepository : config
CliWorkplace <-- ConfigRepository : config CliWorkplace <-- ConfigRepository : config
CliWorkplace -> Application : provision CliWorkplace -> Application : provision ( config )
Application -> ProvInstance : provisionWorkplace Application -> ProvInstance : provisionWorkplace ( type, ssh, ...)
ProvInstance -> ProvisionWorkplace : provisionWorkplace ProvInstance -> ProvisionWorkplace : provisionWorkplace
ProvisionWorkplace -> InfrastructureModules: Various calls like: ProvisionWorkplace -> InfrastructureModules: Various calls like:

View file

@ -7,8 +7,8 @@ import org.domaindrivenarchitecture.provs.workplace.domain.WorkplaceConfig
/** /**
* Use case for provisioning a workplace * Use case for provisioning a workplace
*/ */
fun Prov.provision(conf: WorkplaceConfig) = def { fun provision(prov: Prov, conf: WorkplaceConfig) {
with (conf) { with (conf) {
provisionWorkplace(type, ssh?.keyPair(), gpg?.keyPair(), gitUserName, gitEmail) prov.provisionWorkplace(type, ssh?.keyPair(), gpg?.keyPair(), gitUserName, gitEmail)
} }
} }

View file

@ -29,8 +29,8 @@ private fun provisionWorkplace(cliCommand: WorkplaceCliCommand) {
try { try {
val conf = getConfig(filename) val conf = getConfig(filename)
val prov = createProvInstance(cliCommand.target) val prov = createProvInstance(cliCommand.target, remoteHostSetSudoWithoutPasswordRequired = true)
prov.provision(conf) provision(prov, conf)
} catch (e: IllegalArgumentException) { } catch (e: IllegalArgumentException) {
println( println(