v0.8.20 fix provisioning a workplace

merge-requests/1/merge v0.8.20
az 3 years ago
parent f2fcc5ab77
commit 9edaabff98

@ -18,7 +18,7 @@ apply plugin: 'kotlinx-serialization'
group = 'org.domaindrivenarchitecture.provs'
version = '0.8.19'
version = '0.8.20'
repositories {
mavenCentral()

@ -2,7 +2,6 @@ package org.domaindrivenarchitecture.provs.extensions.workplace
import org.domaindrivenarchitecture.provs.core.*
import org.domaindrivenarchitecture.provs.core.processors.RemoteProcessor
import org.domaindrivenarchitecture.provs.workplace.domain.WorkplaceConfig
import org.domaindrivenarchitecture.provs.workplace.domain.WorkplaceType
import org.domaindrivenarchitecture.provs.extensions.workplace.base.*
import org.domaindrivenarchitecture.provs.workplace.infrastructure.getConfig
@ -17,6 +16,7 @@ import org.domaindrivenarchitecture.provs.ubuntu.secret.secretSources.PromptSecr
import org.domaindrivenarchitecture.provs.ubuntu.user.base.currentUserCanSudo
import org.domaindrivenarchitecture.provs.ubuntu.user.base.makeUserSudoerWithNoSudoPasswordRequired
import org.domaindrivenarchitecture.provs.ubuntu.user.base.whoami
import org.domaindrivenarchitecture.provs.workplace.infrastructure.installDevOps
import java.net.InetAddress
import kotlin.system.exitProcess
@ -97,6 +97,8 @@ fun Prov.provisionWorkplace(
// IDEs
cmd("sudo snap install intellij-idea-community --classic")
installVSC("python", "clojure")
installDevOps()
}
ProvResult(true) // dummy

@ -1,18 +1,15 @@
package org.domaindrivenarchitecture.provs.workplace.application
import org.domaindrivenarchitecture.provs.core.Password
import org.domaindrivenarchitecture.provs.core.Prov
import org.domaindrivenarchitecture.provs.core.ProvResult
import org.domaindrivenarchitecture.provs.core.Secret
import org.domaindrivenarchitecture.provs.extensions.workplace.provisionWorkplace
import org.domaindrivenarchitecture.provs.workplace.domain.WorkplaceConfig
import org.domaindrivenarchitecture.provs.workplace.domain.WorkplaceType
import org.domaindrivenarchitecture.provs.workplace.infrastructure.installDevOps
/**
* Use case for provisioning repos
* Use case for provisioning a workplace
*/
fun Prov.provision(conf: WorkplaceConfig) = def {
if (conf.type == WorkplaceType.IDE) {
installDevOps()
fun Prov.provision(conf: WorkplaceConfig, password: Secret?) = def {
with (conf) {
provisionWorkplace(type, ssh?.keyPair(), gpg?.keyPair(), gitUserName, gitEmail, password)
}
ProvResult(true)
}

@ -35,7 +35,7 @@ private fun provision(cliCommand: CliCommand) {
val password: Secret? = retrievePassword(cliCommand)
val prov: Prov = createProvInstance(cliCommand, password)
prov.provision(conf)
prov.provision(conf, password)
} catch (e: IllegalArgumentException) {
println(
"Error: File\u001b[31m $filename \u001b[0m was not found.\n" +

Loading…
Cancel
Save