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
CliWorkplace <-- ConfigRepository : config
CliWorkplace -> Application : provision
Application -> ProvInstance : provisionWorkplace
CliWorkplace -> Application : provision ( config )
Application -> ProvInstance : provisionWorkplace ( type, ssh, ...)
ProvInstance -> ProvisionWorkplace : provisionWorkplace
ProvisionWorkplace -> InfrastructureModules: Various calls like:

View file

@ -7,8 +7,8 @@ import org.domaindrivenarchitecture.provs.workplace.domain.WorkplaceConfig
/**
* Use case for provisioning a workplace
*/
fun Prov.provision(conf: WorkplaceConfig) = def {
fun provision(prov: Prov, conf: WorkplaceConfig) {
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 {
val conf = getConfig(filename)
val prov = createProvInstance(cliCommand.target)
prov.provision(conf)
val prov = createProvInstance(cliCommand.target, remoteHostSetSudoWithoutPasswordRequired = true)
provision(prov, conf)
} catch (e: IllegalArgumentException) {
println(