refactoring workplace Application.kt & improve CliApplication.puml
This commit is contained in:
parent
c78ea3b432
commit
acfc5ae753
3 changed files with 6 additions and 6 deletions
|
@ -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:
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue