add installVSCodium, updated joker

This commit is contained in:
see 2022-01-07 17:03:24 +01:00
parent fe40f41fa2
commit 42e8948fe4
4 changed files with 48 additions and 8 deletions

View file

@ -69,7 +69,7 @@ fun Prov.provisionWorkplace(
installGopass() installGopass()
aptInstallFromPpa("nextcloud-devs", "client", "nextcloud-client") aptInstallFromPpa("nextcloud-devs", "client", "nextcloud-client")
optional() { optional {
aptInstall(DRAWING_TOOLS) aptInstall(DRAWING_TOOLS)
} }
@ -91,6 +91,7 @@ fun Prov.provisionWorkplace(
// IDEs // IDEs
installVSC("python", "clojure") installVSC("python", "clojure")
//installVSC("python", "clojure")
installIntelliJ() installIntelliJ()
installDevOps() installDevOps()

View file

@ -14,12 +14,15 @@ fun Prov.installVSC(vararg options: String) = requireAll {
prerequisitesVSCinstall() prerequisitesVSCinstall()
installVSCPackage() installVSCPackage()
installVSCodiumPackage()
if (options.contains("clojure")) { if (options.contains("clojure")) {
installExtensions(clojureExtensions) installExtensionsCode(clojureExtensions)
installExtensionsCodium(clojureExtensions)
} }
if (options.contains("python")) { if (options.contains("python")) {
installExtensions(pythonExtensions) installExtensionsCode(pythonExtensions)
installExtensionsCodium(pythonExtensions)
} }
provisionAdditionalTools() provisionAdditionalTools()
@ -57,8 +60,12 @@ private fun Prov.installVSCPackage() = def {
// installVscWithApt() // installVscWithApt()
} }
private fun Prov.installVSCodiumPackage() = def {
cmd("sudo snap install codium --classic")
}
private fun Prov.installExtensions(extensions: List<String>) = optional {
private fun Prov.installExtensionsCode(extensions: List<String>) = optional {
var res = ProvResult(true) var res = ProvResult(true)
for (ext in extensions) { for (ext in extensions) {
res = cmd("code --install-extension $ext") res = cmd("code --install-extension $ext")
@ -67,10 +74,20 @@ private fun Prov.installExtensions(extensions: List<String>) = optional {
// Settings can be found at $HOME/.config/Code/User/settings.json // Settings can be found at $HOME/.config/Code/User/settings.json
} }
private fun Prov.installExtensionsCodium(extensions: List<String>) = optional {
var res = ProvResult(true)
for (ext in extensions) {
res = cmd("codium --install-extension $ext")
}
res
// Settings can be found at $HOME/.config/Code/User/settings.json
}
private fun Prov.provisionAdditionalTools() = requireAll {
internal fun Prov.provisionAdditionalTools() = requireAll {
// Joker // Joker
cmd("curl -Lo joker-0.12.2-linux-amd64.zip https://github.com/candid82/joker/releases/download/v0.12.2/joker-0.12.2-linux-amd64.zip") val version = "0.18.0"
cmd("unzip joker-0.12.2-linux-amd64.zip") cmd("curl -Lo joker-${version}-linux-amd64.zip https://github.com/candid82/joker/releases/download/v${version}/joker-${version}-linux-amd64.zip")
cmd("unzip joker-${version}-linux-amd64.zip")
cmd("sudo mv joker /usr/local/bin/") cmd("sudo mv joker /usr/local/bin/")
} }

View file

@ -0,0 +1,22 @@
package org.domaindrivenarchitecture.provs.workplace.infrastructure
import org.domaindrivenarchitecture.provs.test.defaultTestContainer
import org.domaindrivenarchitecture.provs.ubuntu.install.base.aptInstall
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.Assertions.*
internal class VSCodeKtTest {
@Test
fun provisionAdditionalTools() {
// given
defaultTestContainer().aptInstall("curl unzip")
// when
val res = defaultTestContainer().provisionAdditionalTools()
// then
assertTrue(res.success)
}
}

View file

@ -8,7 +8,7 @@ import org.domaindrivenarchitecture.provs.core.docker.dockerimages.UbuntuPlusUse
import org.domaindrivenarchitecture.provs.core.processors.ContainerStartMode import org.domaindrivenarchitecture.provs.core.processors.ContainerStartMode
import org.domaindrivenarchitecture.provs.core.processors.ContainerUbuntuHostProcessor import org.domaindrivenarchitecture.provs.core.processors.ContainerUbuntuHostProcessor
val testDockerWithSudo = !"true".equals(System.getProperty("testdockerwithoutsudo")?.lowercase()) val testDockerWithSudo = ("true" != System.getProperty("testdockerwithoutsudo")?.lowercase())
const val defaultTestContainerName = "provs_test" const val defaultTestContainerName = "provs_test"